How do I properly use 'import requests python' for web scraping? or What's the best way to handle err

16 Replies, 1688 Views

If import requests python fails, maybe your pip is outdated. Run `pip install --upgrade pip` first.

Also, if you're using PyCharm, sometimes the IDE doesn't sync pip packages. Go to Settings > Python Interpreter and hit the refresh button.

---

Wait, so if I use `python -m pip install requests`, it’ll force the right version? Gonna try that now.

Also, the retry logic snippet is *chef’s kiss*. Definitely stealing that.

But uh... what’s the deal with `User-Agent`? Do APIs really care if I don’t include it? Seems extra.

Messages In This Thread



Users browsing this thread: 1 Guest(s)