I want to select the element with class=""
like
<li class="" > </li>
I used
Elements topProductSecNav = topNavWrapper.select("li[class=]");
but I got java.lang.IllegalArgumentException: String must not be empty
exception.
With XPath expressions it is able to select the elements within the HTML using Jsoup as HTML parser.
A HTML element consists of a tag name, attributes, and child nodes (including text nodes and other elements). From an Element, you can extract data, traverse the node graph, and manipulate the HTML.
jsoup can parse HTML files, input streams, URLs, or even strings. It eases data extraction from HTML by offering Document Object Model (DOM) traversal methods and CSS and jQuery-like selectors. jsoup can manipulate the content: the HTML element itself, its attributes, or its text.
Use this: Elements topProductSecNav=topNavWrapper.select(li[class=\"\"]");
See working example here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With