why i can get nothing?

Jason Friedman jason at powerpull.net
Sun Jan 15 10:40:56 EST 2012


> here is my code :
> import urllib
> import lxml.html
> down='http://download.v.163.com/dl/open/00DL0QDR0QDS0QHH.html'
> file=urllib.urlopen(down).
> read()
> root=lxml.html.document_fromstring(file)
> tnodes = root.xpath("//a/@href[contains(string(),'mp4')]")
> for i,add in enumerate(tnodes):
>     print  i,add
>
> why i can get nothing?

What version of python is this?  Based on the naked "print" I guess
2.x, and I got:

$ /opt/python2/bin/python2.7
Python 2.7.2 (default, Oct 10 2011, 03:43:34)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml.html
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named lxml.html



More information about the Python-list mailing list