Re: Issues a longer xpath expression

2013-02-22 Thread Jean-Michel Pichavant
- Original Message - > I am having issues with the urllib and lxml.html modules. > Here is my original code: import urllib import lxml . html > down = 'http://v.163.com/special/visualizingdata/' file = urllib . > urlopen ( down ). read () root = lxml . html . document_fromstring ( > file

Re: Issues a longer xpath expression

2013-02-22 Thread Philipp Hagemeister
Hi anonymous, your code is working perfectly right. It's just that the only time that you find anything matching //div[@class="col f-cb"] is this one: 名称 视频下载 课程简介 And obviously, there's no in there, so the xpath won't match. Cheers, Philipp On 02/22/2013 02:24 AM, python wrote

Issues a longer xpath expression

2013-02-21 Thread python
I am having issues with the urllib and lxml.html modules. Here is my original code: import urllib import lxml.html down='http://v.163.com/special/visualizingdata/' file=urllib.urlopen(down).read() root=lxml.html.document_fromstring(file) xpath_str="//div[@class='down s-fc3 f-fl']/a" url