How to Solve NameError: name 'urlparse' is not defined -- urllib

Solution: Import the 'urlparse' module

To Solve the error, add the following line to the top of your code.

from urllib import urlparse

 

For more information:
Python urllib urlparse