-
Notifications
You must be signed in to change notification settings - Fork 114
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
Support for :has()
selector
#169
Comments
I think this is still missing support in our upstream |
+1. I'm trying to scrape Wikipedia, which has this sort of nesting. For example: <h2>
<span class="mw-headline" id="Registered_ports">Registered ports</span>
<!-- ... -->
</h2> This selector: |
From what I can see selectors 0.25 (published to crates.io) does have |
I had taken a look into adding fn parse_is_and_where(&self) -> bool {
true
}
fn parse_has(&self) -> bool {
true
} @causal-agent Should it be safe to enable support for these selectors? I can make a PR with these changes unless these selectors are not enabled for a reason. |
Thank you for looking into this!
I think only tests will answer that. Please open a PR, ideally including a test case. I can try to then also give it a spin in a code base containing a pretty diverse set of scrapers and see if anything breaks that is not caught by the tests here. |
@jameshurst when your PR is ready, tag me. I will run some tests and review it ASAP. |
I opened a PR addressing this, have a look |
Hi, do you plan to support the
:has()
selector? To my understanding, this css keyword is needed for selecting objects based on the parent of another known object.Consider the following example:
In order to select the second list item, I would like to use the following selector:
This line however panics as of
scraper
version 0.18.1.The text was updated successfully, but these errors were encountered: