How to Properly Set and Modify Headers in Python Requests? or What Are the Best Practices for Handlin

20 Replies, 2055 Views

Had this exact problem last week! For python requests headers, some sites straight-up reject short or "suspicious" User-Agent strings.

Try mimicking a real browser, like:
`'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'`

Weird, but it works way more often.

Messages In This Thread



Users browsing this thread: 1 Guest(s)