code4craft / xsoup

When jsoup meets XPath.
MIT License
466 stars 151 forks source link

Problem getting attribute value on specific element from element list (by index) #18

Open PatrickHuetter opened 9 years ago

PatrickHuetter commented 9 years ago

An xpath query like this one doesn't work with xsoup:

(//img[contains(@class, 'product_image')])[1]/@src
org.jsoup.select.Selector$SelectorParseException: Could not parse query '(//img[contains(@class, 'product_image')])[1]/@src': unexpected token at '(//img[contains(@class, 'product_image')])[1]/@src'
ynonenull commented 9 years ago

read the readme.md: https://github.com/code4craft/xsoup/blob/master/README.md The contains function syntax looks that: //img[@class*='product_image']