title: Scraping Yahoo Earning Calendar
body: <p>I am new to programming in Python.  I am trying to get the Symbol, and Time.</p>
  
  <p>I am able to get the time that works for me.  It comes out with just the first word, sometimes it is a time, rather than a 'after/before' market closes.</p>
  
  <p>But when it comes to the symbol I don't want any foreign markets, so nothing with a .?? in the symbol.  Here is what I have so far.  Sorry if it is a little sloppy.  It is my first real program in python....</p>
  
  <pre><code>import requests
  import urllib2
  import re
  from bs4 import BeautifulSoup
  
  site= "http://www.nasdaq.com/earnings/report/acrx"
  hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
         'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
         'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
         'Accept-Encoding': 'none',
         'Accept-Language': 'en-US,en;q=0.8'}
  
  url = "http://biz.yahoo.com/research/earncal/20150309.html"
  
  content = urllib2.urlopen(url).read()
  
  soup = BeautifulSoup(content)
  
  m = re.findall('center&gt;&lt;small&gt;\S+ ', content)
  w = re.findall('\?s=\w+',content)
  
  x=0
  lp = (len(m))
  xlp = lp -1
  
  
  for x in range (xlp):
      print x, m[x+1][14:], w[x][3:]
  </code></pre>