Max retries exceeded with URL in requests

What happened here is that itunes server refuses your connection (you’re sending too many requests from same ip address in short period of time) Max retries exceeded with url: /in/app/adobe-reader/id469337564?mt=8 error trace is misleading it should be something like “No connection could be made because the target machine actively refused it”. There is an issue at about python.requests … Read more

(Python) AttributeError: ‘NoneType’ object has no attribute ‘text’

Instead of checking if child.find(‘EmentaMateria’).text is not None, you should make sure that child.find(‘EmentaMateria’) is not None first. Also, you should store the returning value of child.find(‘EmentaMateria’) to avoid calling it twice. Lastly, you should assign ementa a default value if child.find(‘EmentaMateria’) is None; otherwise your print function below will be referencing an un-initialized variable. Change: to: Alternatively, you can use the built-in function getattr to do the same without a temporary variable:

Importing requests module does not work

The most common reason for this is that you have two versions of Python 2.x, and the pip that comes first in your PATH doesn’t go with the python that comes first in your PATH. There are two ways that can happen. First, you may have, e.g., /usr/local/bin before /usr/bin on your PATH, but your /usr/local copy of Python doesn’t have pip. So, when you run pip install requests, that’s /usr/bin/pip, which … Read more

ImportError: No module named requests

Requests is not a built in module (does not come with the default python installation), so you will have to install it: OSX/Linux Use $ pip install requests (or pip3 install requests for python3) if you have pip installed. If pip is installed but not in your path you can use python -m pip install requests (or python3 -m pip install requests for python3) Alternatively … Read more