2

Please bear with me I am brand new to web scraping! I want to scrape all of the exit poll data off this CNN webpage http://www.cnn.com/election/results/exit-polls for this question I will just ask to scrape the first exit poll, the gender one. the code below doesnt print anything. what I am doing wrong? not looping through all the tags?

import urllib2
from bs4 import BeautifulSoup
html = urllib2.urlopen('http://www.cnn.com/election/results/exit-polls').read()
soup = BeautifulSoup(html)
table = soup.find("div",{"class":"exit-poll__question"})
print table
Flimzy
  • 68,325
  • 15
  • 126
  • 165
ziggy
  • 1,354
  • 3
  • 18
  • 44

1 Answers1

1

you can find the data in this link

you can find the link in chrome's dev-tools>>Network

so what you need to do is to request the url

i hope this will help.

宏杰李
  • 11,204
  • 2
  • 24
  • 33