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

Add support for :has from the CSS4 specification #161

Closed
parthjoshi2007 opened this issue Oct 19, 2019 · 1 comment
Closed

Add support for :has from the CSS4 specification #161

parthjoshi2007 opened this issue Oct 19, 2019 · 1 comment

Comments

@parthjoshi2007
Copy link

I was trying to determine the status of support for CSS4 selectors in scrapy but could not find any information. Is there any plan to add such support? I think the CSS4 working draft has some very useful extensions that other libraries like soupsieve, the CSS selector library used by Beautiful Soup, for example, already support.

In particular I would like to make the case for :has and possibly also :is. In the course of my experiments with scraping websites (for which scrapy is truly a lifesaver), I have come across several websites where I need to, just as an example, get the p tag after the p tag containing an image. See for example getting the job titles out of this webpage. Using :has this would be trivial with p:has(strong) + p but it is not possible currently with parsel.

And before people jump on me saying "Hey! Just use XPath selectors", I know that I could use XPath. But XPath selectors have a much steeper learning curve than CSS selectors and I can train people to use CSS much more easily than XPath.

@Gallaecio
Copy link
Member

This is a duplicate of scrapy/cssselect#66 (parsel implements CSS support through cssselect).

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

2 participants