0

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

18
  • 1
    Are the Windows and Linux machines on the same network, or different networks? Commented Sep 7, 2023 at 14:37
  • @JohnGordon they are on different network. windows is home PC and linux is machine of hosting provider Commented Sep 7, 2023 at 14:43
  • Website is not protected by Cloudfare How do you know this? Commented Sep 7, 2023 at 14:43
  • 1
    Perhaps the website doesn't like the Linux machine's IP domain. Commented Sep 7, 2023 at 14:44
  • 1
    The difference is very likely due to the IP domains of the two machines, not any actual difference in the requests. Commented Sep 7, 2023 at 15:09

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.