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

CSS selector :has pseudo-class #40179

Closed
Bilge opened this issue Feb 14, 2021 · 19 comments · May be fixed by #49388
Closed

CSS selector :has pseudo-class #40179

Bilge opened this issue Feb 14, 2021 · 19 comments · May be fixed by #49388
Labels
CssSelector Feature Help wanted Issues and PRs which are looking for volunteers to complete them. Stalled

Comments

@Bilge
Copy link
Contributor

Bilge commented Feb 14, 2021

Description
It would be very useful to have the :has pseudo-class. It is currently in working draft state, although JQuery implemented it years ago.

Example

$crawler->filter('.foo:has(.bar)');
@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?

@momala454
Copy link

I do would like the feature

@carsonbot carsonbot removed the Stalled label Aug 16, 2021
@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?

@momala454
Copy link

momala454 commented Feb 17, 2022

yes but my hopes are low

@carsonbot carsonbot removed the Stalled label Feb 17, 2022
@nicolas-grekas
Copy link
Member

Hope doesn't work, sending PRs does :)
Would you like having a look? If nobody cares to implement this, we'd better close.

@Bilge
Copy link
Contributor Author

Bilge commented Feb 17, 2022

I dunno. I'm hoping really hard, here.

@momala454
Copy link

momala454 commented Feb 17, 2022

i have no knowledge in xpath or how this library works, and i'm currently using another (outdated) library. The missing :has was one thing that prevented me from using it
i don't know if :contains() is supported, which is also a selector i would like

@nicolas-grekas
Copy link
Member

I don't know either. Might be a nice opportunity to learn about it if you're up for having a look.

@momala454
Copy link

the last PR i submitted to other projects were ignored, it does not make me want to learn xpath and symfony css selector to make a new pr :)

@nicolas-grekas
Copy link
Member

Sorry about that 😞
This doesn't change the dynamics of OSS: ppl that need something are the best to contribute. Who else otherwise? 🤷

@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?

@carsonbot
Copy link

Hello? This issue is about to be closed if nobody replies.

@Bilge
Copy link
Contributor Author

Bilge commented Oct 29, 2022

@carsonbot carsonbot removed the Stalled label Oct 29, 2022
@stof
Copy link
Member

stof commented Dec 23, 2022

https://github.com/scrapy/cssselect (the python code from which the CssSelector component was ported) has added support for :has() in their 1.2.0 release

@stof stof added the Help wanted Issues and PRs which are looking for volunteers to complete them. label Dec 23, 2022
@Bilge
Copy link
Contributor Author

Bilge commented Dec 23, 2022

Relevant PR: scrapy/cssselect#115.

@franckranaivo
Copy link
Contributor

franckranaivo commented Feb 15, 2023

I opened a PR for this issue maybe it can help.

@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?

@carsonbot
Copy link

Hello? This issue is about to be closed if nobody replies.

@carsonbot
Copy link

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CssSelector Feature Help wanted Issues and PRs which are looking for volunteers to complete them. Stalled
Projects
None yet
7 participants