Hi,
Python newb here so go easy on me, using 2.7 because I am following a video course that involves scraping web pages for data and the instructor is demonstrating with that version, but when he does it with Spyder, the console shows the output data. Mine doesn't.
What I wanna do is save the data to a .csv but right now I'm trying to find out why beautifulsoup is failing.
Thanks.
EDIT: I am on Windows 7 x64.
Python newb here so go easy on me, using 2.7 because I am following a video course that involves scraping web pages for data and the instructor is demonstrating with that version, but when he does it with Spyder, the console shows the output data. Mine doesn't.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from os import chdir import pandas as pd import csv #webscraping functions from bs4 import BeautifulSoup import urllib2 chdir( "C:\\Users\\Admin\\Documents\\test" ) header = { 'User-Agent' : 'Mozilla/5.0' } req = urllib2.Request(istst, headers = header) page = urllib2.urlopen(req) soup = BeautifulSoup(page, "lxml" ) soup |
Thanks.
EDIT: I am on Windows 7 x64.