Re: Using Xpath to parse a Yahoo Finance page

2012-12-02 Thread Stefan Behnel
MRAB, 03.12.2012 03:25: > On 2012-12-03 01:23, Jason Hsu wrote: >> I'm trying to extract the data on "total assets" from Yahoo Finance using >> Python 2.7 and lxml. >> >> Here is a special test script I set up to work on this issue: >> >> import urllib >> import lxml >> import lxml.h

Re: Using Xpath to parse a Yahoo Finance page

2012-12-02 Thread Jason Hsu
On Sunday, December 2, 2012 8:25:45 PM UTC-6, MRAB wrote: > > list_row2 = doc2.xpath(u'.//td[strong[contains(text(),"Total > > Assets")]]/following-sibling::td/strong/text()') > Thanks, MRAB. Your suggestion works! -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Xpath to parse a Yahoo Finance page

2012-12-02 Thread MRAB
On 2012-12-03 01:23, Jason Hsu wrote: I'm trying to extract the data on "total assets" from Yahoo Finance using Python 2.7 and lxml. Here is a special test script I set up to work on this issue: import urllib import lxml import lxml.html url_local1 = "http://www.smartmone