[Tutor] Modifying files in a directory.
qsqgeekyogdty at tiscali.co.uk
qsqgeekyogdty at tiscali.co.uk
Thu May 29 14:42:36 CEST 2008
Hi
Yes I did notice I don't pass anything in the upDateTable ;)
My problem is having to understand how to actually do this recursively
On the command line seems simple and I get:
>>> from BeautifulSoup import BeautifulSoup
>>> path = '/home/david/test/stack.html'
>>> path
'/home/david/test/stack.html'
>>> html = open(path, 'r')
>>> html
<open file ''/home/david/test/stack.html', mode 'r' at 0x5343c8>
>>> soup = BeautifulSoup(html)
>>> ord_tbl_price = soup.find('td', {'class': 'order_tbl_price'})
>>> ord_tbl_price
<td class="order_tbl_price"><span class="order_table_price_small"
>From</span> $32.66</td>
>>>
So now, how do I reduce the price by 15% and write it back to the
document?
Thanks
David
________________________
Guard against online ID theft - http://www.tiscali.co.uk/spyguard
More information about the Tutor
mailing list