Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19009 > unrolled thread
| Started by | Jason Friedman <jason@powerpull.net> |
|---|---|
| First post | 2012-01-15 15:40 +0000 |
| Last post | 2012-01-15 15:40 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: why i can get nothing? Jason Friedman <jason@powerpull.net> - 2012-01-15 15:40 +0000
| From | Jason Friedman <jason@powerpull.net> |
|---|---|
| Date | 2012-01-15 15:40 +0000 |
| Subject | Re: why i can get nothing? |
| Message-ID | <mailman.4773.1326642060.27778.python-list@python.org> |
> 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 top | Article view | comp.lang.python
csiph-web