0

Good morning, Since yesterday, I'm having timeouts doing requests to ebay website. The code is simple:

import requests
headers = {
        "User-Agent": 
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"}

htlm=requests.get("https://www.ebay.es",headers=headers).text

Tested with google and it works. This is the response I receive: '\nGateway Timeout - In read \n\n

Gateway Timeout

\nThe proxy server did not receive a timely response from the upstream server.

\nReference #1.477f1602.1645295618.7675ccad\n\n'

What happened or changed? How could I solve it?

1
  • Remove the headers and it should work. Is there a reason you need that User-Agent? Commented Feb 19, 2022 at 18:43

1 Answer 1

1

Removing the headers should work. Perhaps they don't like that user agent for some reason.

import requests
# headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"}
headers = {}
url = "https://www.ebay.es"

response = requests.get(url, headers=headers)
html_text = response.text
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.