HTML Parsing

Gabriel Genellina gagsl-py at yahoo.com.ar
Sat Feb 10 18:56:01 EST 2007


En Sat, 10 Feb 2007 20:07:43 -0300, mtuller <mituller at gmail.com> escribió:

> <tr >
> <td headers="col1_1"  style="width:21%"   >
> <span  class="hpPageText" >LETTER</span></td>
> <td headers="col2_1"  style="width:13%; text-align:right"   >
> <span  class="hpPageText" >33,699</span></td>
> <td headers="col3_1"  style="width:13%; text-align:right"   >
> <span  class="hpPageText" >1.0</span></td>
> <td headers="col4_1"  style="width:13%; text-align:right"   >
> </tr>
>
> I want to extract the 33,699 (which is dynamic) and set the value to a
> variable so that I can insert it into a database. I have tried parsing  
> [...]
> I have also tried Beautiful Soup, but had trouble understanding the
> documentation, and HTMLParser doesn't seem to do what I want. Can[...]

Just try harder with BeautifulSoup, should work OK for your use case.
Unfortunately I can't give you an example right now.

-- 
Gabriel Genellina




More information about the Python-list mailing list