title: Python 3: Parsing a date from a container string
body: <p>I have a webpage from which I'm trying to get a date. I know what the format is, so the solution should be as easy as <a href="http://docs.python.org/py3k/library/time.html#time.strptime" rel="nofollow"><code>time.strptime(format)</code></a>, but the problem is this:<br>
  <code>If string cannot be parsed according to format, or if it has excess data after parsing, ValueError is raised.</code><br>
  I'm trying to parse something that looks like:  </p>
  
  <pre><code>&lt;tr&gt;&lt;td align="center"&gt;&lt;b&gt;Create time&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;&lt;tr&gt;&lt;td align="center" bgcolor="#DDDDDD"&gt;Between August 1, 2012, 8:05 pm and August 1, 2012, 8:06 pm&lt;/td&gt;  
  </code></pre>
  
  <p>The corresponding format would be <code>%B %d, %Y</code> (it doesn't really matter which date, I just need a date).<br>
  I could use a regular expression (e.g. <code>([JFMASOND][a-z]{2,8}) ([0-9]{1,2}), ([0-9]{4})</code> ) to get the relevant part of the string out, but then I may as well just get the values themselves from the regex and do the necessary conversions myself. Is there any way to use strptime on the container string, so to speak? It shouldn't be too hard for strptime to just keep crunching on the string until it gets a format match...<br>
  (If I do have to do it myself, is there a better way than a regex?)</p>