title: Python to get onclick values
body: <p>I'm using Python and BeautifulSoup to scrape a web page for a small project of mine. The webpage has multiple entries, each separated by a table row in HTML. My code partially works however a lot of the output is blank and it won't fetch all of the results from the web page or even gather them into the same line. </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Sample Website&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;table&gt;
  &lt;td class=channel&gt;Artist&lt;/td&gt;&lt;td class=channel&gt;Title&lt;/td&gt;&lt;td class=channel&gt;Date&lt;/td&gt;&lt;td class=channel&gt;Time&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;Lorem Ipsum&lt;/td&gt;&lt;td&gt;&lt;a href="#" onClick="searchDB('LoremIpsum','FooWorld')"&gt;FooWorld&lt;/a&gt;&lt;/td&gt;&lt;td&gt;12/10/2014&lt;/td&gt;&lt;td&gt;2:53:17 PM&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I want to only extract the values from the onclick action 'searchDB', so for example 'LoremIpsum' and 'FooWorld' are the only two results that I want.</p>
  
  <p>Here is the code that I've written. So far, it properly pulls some of the write values, but sometimes the values are empty. </p>
  
  <pre><code>response = urllib2.urlopen(url)
  
  html = response.read()
  
  soup = bs4.BeautifulSoup(html)
  
  properties = soup.findAll('a', onclick=True)
  
  for eachproperty in properties:
      print re.findall("'([a-zA-Z0-9]*)'", eachproperty['onclick'])
  </code></pre>
  
  <p>What am I doing wrong?</p>