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
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
ziggy
  • 1,488
  • 5
  • 23
  • 51

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,820
  • 2
  • 28
  • 35