Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19009 > unrolled thread

Re: why i can get nothing?

Started byJason Friedman <jason@powerpull.net>
First post2012-01-15 15:40 +0000
Last post2012-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.


Contents

  Re: why i can get nothing? Jason Friedman <jason@powerpull.net> - 2012-01-15 15:40 +0000

#19009 — Re: why i can get nothing?

FromJason Friedman <jason@powerpull.net>
Date2012-01-15 15:40 +0000
SubjectRe: 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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web