Data scraping with Python and Beautiful Soup -
i making first steps python & beautiful soup in order scrape data russian statistics website.
looking @ different examples here on stack overflow, think code correct, , yet simple query not return site. when executing code, python command line remains blank, not return error.
what's wrong here?
my (very simple) code:
from bs4 import beautifulsoup import urllib2 url = "http://www.gks.ru/bgd/free/b00_25/isswww.exe/stg/d000/000715.htm" page = urllib2.urlopen(url) soup = beautifulsoup(page.read()) print(soup)
you need specify parser:
soup = beautifulsoup(page.read(), 'html.parser')
Comments
Post a Comment