Question

I am not all that familiar with Python, but I am trying to write a simple script to scrape NYTimes articles.

I started using urllib2 and kept getting 403 errors and have no idea what header configuration I can try. So I thought perhaps using the requests library would be better.

I installed it with the usual: python setup.py install. Does the code have to be anywhere in particular? I have it in a temp directory and assume it will install things in the right place in my python33 installation.

When I try: import requests I get, among other things: ImportError: No module named 'requests.packages.urllib3.util'

Any ideas?

Was it helpful?

Solution

Your errors are most likely because requests requires additional libraries.

Try installing it with

pip install requests

Take a look at :

http://docs.python-requests.org/en/latest/user/install/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top