-
Notifications
You must be signed in to change notification settings - Fork 81
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
Getting nodes with a specific class #31
Comments
IIRC, this is one of dozens of bugs. However, you might try getting rid of the space in your not-working example: CSelection c = doc.find("div[class=' the-row']"); Should be: CSelection c = doc.find("div[class='the-row']"); |
On second thought you're not even doing a class selector correctly. See source here. Class selector should be ".the-row". You're doing an attribute selector, which is requiring a full, complete match. |
@TechnikEmpire I have an other question: it is possible to match 2 or more conditions with 'find'? Thank you. |
You should be able to run basically any css3 selector. Google how to compose such selectors and they should work. I rewrote this library quite a while ago and there are a lot of bugs that cause certain selectors and other things to fail, but I can't remember them all. So you may find that perfectly valid selectors fail or give improper results. If your code is remotely critical, write some tests to verify it because I'd bet my bottom dollar they're not all going to work correctly. It's not the author of this port's fault either, a great many of the bugs were ported over from cascadia, the original source. |
Thank you for explanation. |
Hi,
I want to get all nodes with a class containing (not matching exactly) a specific value.
I used 'find', but it returns only the nodes with class matching exactly the value.
For example, if I have a:
This do not work:
this works:
Thanks.
The text was updated successfully, but these errors were encountered: