why can't i get All text within this xpath in this page?
-
27-10-2019 - |
题
here is the url and xpath . url : http://product.dangdang.com/product.aspx?product_id=21026883&ref=book-01-E1 xpath: //span[@class='detail_all']
doc.SelectSingleNode(xpath).innertext just can't get ALL innertext with this xpath !
why ?
how can i fix this ?
thx !
解决方案
You cannot use SelectSingleNode
, as it will only return the first span
or node if you want.
You have to iterate over doc.SelectNodes
and concatenate your results.
不隶属于 StackOverflow