NameError: name 'urllib2' is not defined - Richard Tu's Blog
www.maolintu.com › 2018/01/21 › nameerror-nameJan 21, 2018 · NameError: name ‘urllib2’ is not defined. I am studying mongoDB with python, I met this problem. When I tried to open a url by python, I copied some code from internet like following: import jsonimport urllib2import pymongo# connect to mongoconnection = pymongo.MongoClient("mongodb://localhost")# get a handle to the reddit databasedb = connection.redditstories = db.stories# drop existing collectionstories.drop()# get the reddit home pagereddit_page = urllib2.urlopen("https://www.
Python for Software Design: How to Think Like a Computer ...
https://books.google.no › booksmembership bisection search, 118 dictionary, 120 list, 105 set, 121 memo, 127, ... 129, 133, 142, 176 mutable object, as default value, 199 NameError, 29, ...