Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > why the conut( ) can not get the number?

Reply
Thread Tools

why the conut( ) can not get the number?

 
 
水静流深
Guest
Posts: n/a
 
      12-09-2012
i wnat to get the number of a atrributes in a xpath,here is my code,why i can not get the number ?
import urllib
import lxml.html
down="http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html"
file=urllib.urlopen(down).read()
root=lxml.html.document_fromstring(file)
for order,node in enumerate(root.xpath('//li[@class="toctree-l1"]')):
print order,node.xpath('.//a[count(*)]')
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get ubuntu ! Get ubuntu ! Get ubuntu ! Get ubuntu ! Getubuntu Windows 64bit 1 06-01-2009 08:54 AM
Why :: ? Why not : ? Why not . ? <- less clutter ?!? Skybuck Flying C++ 16 08-25-2007 09:48 PM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
why why why does function not work Horace Nunley ASP .Net 1 09-27-2006 09:52 PM



Advertisments