Python Forum
NameError: name 'download' is not defined
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NameError: name 'download' is not defined
#1
I am trying to extract the country area from example website. And I got following errors. I am using python version 3.6
from bs4 import BeautifulSoup
url = 'http://example.webscraping.com/places/default/view/Australia-14'
html = download(url)
soup = BeautifulSoup(html)
# locate the area row
tr = soup.find(attrs={'id':'places_area_row'})
td = tr.find(attrs={'class':'w2p_fw'}) #locate the date elements
area = td.text #extract the text form the data element
print (area)
Error: "NameError: name 'download' is not defined"
Reply


Messages In This Thread
NameError: name 'download' is not defined - by ntdropper - Jan-13-2018, 06:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  NameError :name 'name' is not defined Suzzy_ 4 19,069 Dec-27-2019, 09:04 AM
Last Post: LeanbridgeTech
  NameError: Name 'path' is not defined aniyanetworks 9 59,949 Jun-29-2018, 03:21 PM
Last Post: gontajones
  NameError: name 'bsObj' is not defined Blue Dog 14 15,866 Oct-24-2016, 08:34 AM
Last Post: Blue Dog

Forum Jump:

User Panel Messages

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