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

Suggestion: operators at the start of a selector #13

Closed
svivian opened this issue Feb 23, 2010 · 5 comments
Closed

Suggestion: operators at the start of a selector #13

svivian opened this issue Feb 23, 2010 · 5 comments

Comments

@svivian
Copy link

svivian commented Feb 23, 2010

In jQuery, when doing further DOM selection on an element (e.g. using find), you can use operators at the start of the query to filter based on the current element.

For example, this jQuery: $('table.data > tbody > tr').find('> td') will select td elements that are direct children of the rows found in the first query. It will not select td elements from any nested tables.

With JSoup, this would be something like:

Elements tableRows = doc.select( "table.data>tbody>tr" );
for ( Element tr : tableRows )
{
    // do something with tr here
    tr.select(">td");
}

I currently get this error: Could not parse query >td

@jhy
Copy link
Owner

jhy commented Feb 23, 2010

Good idea, thanks.

@jhy
Copy link
Owner

jhy commented Feb 24, 2010

Allow combinators at start of selector query

Closed by 8b1abce

@svivian
Copy link
Author

svivian commented Mar 22, 2010

Is this fix in version 0.3.1? I just tried and I'm still getting the selector parsing error.

@jhy
Copy link
Owner

jhy commented Mar 22, 2010

Sorry, no, it's in the next (unreleased) version. See http://github.com/jhy/jsoup/blob/master/CHANGES

The next version is ready for release, hopefully in the next few days. I'm struggling a bit for time with moving house etc.

@svivian
Copy link
Author

svivian commented Mar 23, 2010

OK no rush or anything, was just checking. Couldn't find a reference to the version number in that checkin link above. In future I'll keep an eye on that changes file :)

michael-simons pushed a commit to michael-simons/jsoup that referenced this issue Jul 12, 2011
zazi pushed a commit to dswarm/jsoup that referenced this issue Oct 15, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants