Python Forum
this would be silly if it as not driving mr crazy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
this would be silly if it as not driving mr crazy
#1
I am using 2.7.3
import urllib
htmlfile = urllib.urlopen("http://www.google.com")
htmltext = htmlfile.read()
this is the error I am geting
Error:
Traceback (most recent call last):   File "C:/Users/renny and kite/Documents/Hacking with python/web scraping tut/getting_page_html", line 1, in <module>     htmlfile = urllib.urlopen("http://www.google.com") NameError: name 'urllib' is not defined
I went through 15 learn python videos, this never came up in the course. I would think people that teach this stuff would put error in the course
so when you get one you know how to fix it. Code that run fine don't do you any good when you tyring fine errors

This is so simple 4 line s of code and it does not work,
why?
thank you
Reply


Messages In This Thread
this would be silly if it as not driving mr crazy - by Blue Dog - Oct-27-2016, 11:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  A crazy project involving webpage interaction apsaditya 7 5,115 May-20-2018, 05:39 AM
Last Post: apsaditya

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020