Re: why the conut( ) can not get the number?
> 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
> for order,node in enumerate(root.xpath('//li[@class="toctree-l1"]')):
> print order,node.xpath('.//a[count(*)]')
This looks more like an xpath than a python problem. I'm no xpath expert --
and you don't describe the expected outcome -- maybe you want
print order, node.xpath("count(.//a)")
|All times are GMT. The time now is 05:42 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.