Skip to content

Instantly share code, notes, and snippets.

@alexwoolford
Last active August 29, 2015 14:08
Show Gist options
  • Save alexwoolford/5adacc8bd4a339339335 to your computer and use it in GitHub Desktop.
Save alexwoolford/5adacc8bd4a339339335 to your computer and use it in GitHub Desktop.
Nasdaq Calendar StackOverflow question
# http://stackoverflow.com/questions/26793632/beautifulsoup-unable-to-to-read-the-complete-html-table
# coding: utf-8
# In[1]:
import urllib2
from bs4 import BeautifulSoup
# In[2]:
header = {'User-Agent': 'Mozilla/5.0'}
url="http://www.nasdaq.com/earnings/earnings-calendar.aspx?date=2014-Oct-28"
req = urllib2.Request(url,headers=header)
html = urllib2.urlopen(req).read()
# In[3]:
soup = BeautifulSoup(html)
# In[4]:
len(soup.find('table', {'class':'USMN_EarningsCalendar'}).findAll('tr'))
# 188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment