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
#4
Just remove download,and use Requests(is what should by used anyway in the download reference).
from bs4 import BeautifulSoup
import requests

url = 'http://example.webscraping.com/places/default/view/Australia-14'
url_get = requests.get(url)
soup = BeautifulSoup(url_get.content, 'html.parser')
contry = soup.find('tr', id="places_country__row")
print(contry.text)
Output:
Country: Australia
Reply


Messages In This Thread
RE: NameError: name 'download' is not defined - by snippsat - Jan-13-2018, 07:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  NameError :name 'name' is not defined Suzzy_ 4 19,021 Dec-27-2019, 09:04 AM
Last Post: LeanbridgeTech
  NameError: Name 'path' is not defined aniyanetworks 9 59,836 Jun-29-2018, 03:21 PM
Last Post: gontajones
  NameError: name 'bsObj' is not defined Blue Dog 14 15,789 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