Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19009
| References | <CA+YdQ_76P-UJmEiD7dySoGXxwjFx_Tm-uww8KYJ5Dq0-zDSM1Q@mail.gmail.com> |
|---|---|
| Date | 2012-01-15 15:40 +0000 |
| Subject | Re: why i can get nothing? |
| From | Jason Friedman <jason@powerpull.net> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4773.1326642060.27778.python-list@python.org> (permalink) |
> 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
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: why i can get nothing? Jason Friedman <jason@powerpull.net> - 2012-01-15 15:40 +0000
csiph-web