title: Accessing Table data with BeautifulSoup
body: <p>The following code:</p>
  
  <pre><code>from urllib.request import urlopen
  from urllib.error import HTTPError
  from bs4 import BeautifulSoup
  import re
  
  def getDates(URL):
      dates = []
      # if page not found, HTTPError is thrown
      try:
          html = urlopen(URL)
      except HTTPError:
          print("Page not found.")
          return None
  
      bsObj = BeautifulSoup(html, "lxml")
      data = bsObj.find("table", {"class":"sortable wikitable"}).children
      for child in data:
          print(child)
  </code></pre>
  
  <p>Yields the following sample output:</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td&gt;&lt;a href="/wiki/89th_Academy_Awards" title="89th Academy Awards"&gt;89th&lt;/a&gt;&lt;/td&gt;
  &lt;td&gt;February 26, 2017&lt;/td&gt;
  &lt;td&gt;2016&lt;/td&gt;
  &lt;td&gt;&lt;i&gt;&lt;a href="/wiki/Moonlight_(2016_film)" title="Moonlight (2016 film)"&gt;Moonlight&lt;/a&gt;&lt;/i&gt;&lt;/td&gt;
  &lt;td&gt;&lt;span class="sortkey" style="display:none;"&gt;217 !&lt;/span&gt;&lt;span class="sorttext"&gt;3 hours, 49 minutes&lt;/span&gt;&lt;/td&gt;
  &lt;td&gt;32.9 million&lt;/td&gt;
  &lt;td&gt;22.4&lt;/td&gt;
  &lt;td rowspan="2"&gt;&lt;a href="/wiki/Jimmy_Kimmel" title="Jimmy Kimmel"&gt;Jimmy Kimmel&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>The only row I want to scrape is the row with the date. Here, it is <strong>February 26, 2017</strong>. There are about 80+ entries just like this.  I have tried asking for the sibling of the top <code>td</code> row and got a <code>NavigableString error</code>, which I could not except or loop my way out of (as suggested in other posts), as Spyder said NavigableString was undefined, could not be imported, and was not a recognised error (excepting it as an <code>AttributeError</code> yielded a blank screen). I get that there is a blank space there. I've tried finding every child with a <code>td</code> tag that has a string that resolves to a regular expression corresponding to a date. That didn't work either. The error said I could put that parameter in my .find() function, though the docs -- which I have in front of me -- say otherwise. </p>
  
  <p>Thoughts on what is going wrong, and how I might get this one row? </p>