why the conut( ) can not get the number?

Discussion in 'Python' started by Ë®¾²Á÷Éî, Dec 9, 2012.

  1. 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(*)]')
     
    Ë®¾²Á÷Éî, Dec 9, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    933
    Mark Rae
    Dec 21, 2006
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,124
    Smokey Grindel
    Dec 2, 2006
  3. Jekyll
    Replies:
    2
    Views:
    434
    Victor Bazarov
    Apr 24, 2007
  4. Skybuck Flying
    Replies:
    16
    Views:
    692
    tragomaskhalos
    Aug 25, 2007
  5. Peter Otten
    Replies:
    0
    Views:
    139
    Peter Otten
    Dec 10, 2012
Loading...

Share This Page