403 forbidden python windows vs linux

122 Views Asked by At

When running Python requests from a window's desktop (Python 3.11.4), it works fine; once running from Linux's server (Python 3.8.6 or Python 3.10.1), it returns 403 code forbidden (please enable JS or disable any ad blocker).

import requests

payload = {
    'VoyageReference': '',
    'VesselReference': 'CMA CGM A. LINCOLN ; CGLCO'
}  

headers = {
    'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36'
}

r = requests.get('https://www.cma-cgm.com/ebusiness/schedules/voyage/detail', params=payload, headers=headers)

Same behavior with sessions and different modules such as urllib, requests_html, etc. I have tried proxies as well do be sure that ip is not banned. Website is not protected by Cloudfare, no authorization needed. Many combinattions of headers were tested including cookies(which are acttually not required). selenium is not solution for this question.

fake request from postman ( no captcha offered)

UPD: response headers from Win and linux

0

There are 0 best solutions below