How to Use a Proxy with Python Requests? A Step-by-Step Guide or Best Practices for Setting Up a Pyth

14 Replies, 1041 Views

PSA: if you're scraping, rotate your user-agent too! Some sites block proxy traffic with default python-requests headers.

Try this:
```python
headers = {'User-Agent': 'Mozilla/5.0'}
requests.get(url, proxies=proxy, headers=headers)
```
Might save you a headache.

Messages In This Thread



Users browsing this thread: 1 Guest(s)