Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to extract all text data from an HTML tag which has one or more than one child tags? #28

Open
sarika34 opened this issue Jan 13, 2017 · 4 comments

Comments

@sarika34
Copy link

sarika34 commented Jan 13, 2017

`<div class="columns small>

Xsoup use Jsoup as HTML parser.

` In above example, text data are present inside and

. Please give me solution to extract data from both the tags together as "Xsoup use Jsoup as HTML parser." Thanx.

@code4craft
Copy link
Owner

Use function defined in Xsoup.
//div[@Class='columns small']/allText()

@sarika34
Copy link
Author

[https://github.com/code4craft/xsoup] according to this url, i was confused that allText works or not..!!
By the way thank u so much.

@helloworldtang
Copy link

@code4craft
How to extract the 2th child text attribute value?

@helloworldtang
Copy link

find a way to choose nth child tag,
String next_page_css = "#homepage_top_pager > div:nth-child(1) > a:nth-child(7)";
page.getHtml().css(next_page_css).

but how to use tag[n]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants