Python Site Scrape Help Needed
<p>I'm new to python (and a lot of coding outside of SQL, SAS, and a little R) and I am trying to use it to build a dataset based on data from a number of different web pages. Thanks in advance for your help.</p>

<p>I am using Python 3.4.4 and have successfully pulled the code of the sites, but I'm having trouble with writing the regex code to isolate the specific data elements/metrics I want. Below is a sample of the webpage's code and I want to isolate the whole numbers by themselves between the tdclass statements. </p>

<pre><code>&lt;tr class="Company"&gt;&lt;td class="Company"&gt; &lt;ahref="http://www.theacsi.org/index.php?option=com_content&amp;view=article&amp;id=149&amp;catid=&amp;Itemid=214&amp;amp;c=Liz+Claiborne&amp;amp;i=Apparel" id="L"&gt;Liz Claiborne&lt;/a&gt; &lt;/td&gt;&lt;td class="Baseline"&gt; 84 &lt;/td&gt;&lt;td class="Y1995"&gt; 81 &lt;/td&gt;&lt;td class="Y1996"&gt; 81 &lt;/td&gt;&lt;td class="Y1997"&gt; 77 &lt;/td&gt;&lt;td class="Y1998"&gt; 78 &lt;/td&gt;&lt;td class="Y1999"&gt; 76 &lt;/td&gt;&lt;td class="Y2000"&gt; 79 &lt;/td&gt;&lt;td class="Y2001"&gt; 79 &lt;/td&gt;&lt;td class="Y2002"&gt; 80 &lt;/td&gt;&lt;td class="Y2003"&gt; 78 &lt;/td&gt;&lt;td class="Y2004"&gt; 79 &lt;/td&gt;&lt;td class="Y2005"&gt; 78 &lt;/td&gt;&lt;td class="Y2006"&gt; 81 &lt;/td&gt;&lt;td class="Y2007"&gt; 79 &lt;/td&gt;&lt;td class="Y2008"&gt; 79 &lt;/td&gt;&lt;td class="Y2009"&gt; 82 &lt;/td&gt;&lt;td class="Y2010"&gt; 79 &lt;/td&gt;&lt;td class="Y2011"&gt; 79 &lt;/td&gt;&lt;td clas
</code></pre>

<p>I think you might want to look at lxml and xpath not to mention other scraping soft. Thousends of posts in aera. Check the link below:</p>

<p><a href="http://docs.python-guide.org/en/latest/scenarios/scrape/" rel="nofollow">http://docs.python-guide.org/en/latest/scenarios/scrape/</a></p>

<p>If you dont like to use other modules use build RE (Regular expressions) module, which provides you usefull informations about how to extract specific text from string.</p>

python html regex