coder_For_Life22
coder_For_Life22

Reputation: 26971

Using Selector with JSOUP and DOM

After reading through the documentation.

Ive come to realize the selector method is what i need to be able to scan different html sources(such as webpages) to retreive certain tags.

For example. I have a list of htmls that have articles.

when a item is clicked in the listview, the html is parsed for certain tags to extract the article text.

I know the Selector method would allow me to set a pattern.

But what is the right format for what i am trying to do for the selector method?

Upvotes: 0

Views: 428

Answers (1)

BalusC
BalusC

Reputation: 1108712

But what is the right format for what i am trying to do for the selector method?

It should be in CSS selector syntax. Jsoup also supports some additional pseudoselectors. You can find them all in this cookbook documentation and in the Selector API documentation.

If you're having problems with figuring the right selector for your functional requirement, then just press Ask Question button here and elaborare in detail what HTML you have and point out what part exactly you want to extract. This way we can post an answer showing the desired selector syntax.

Upvotes: 1

Related Questions