Suggestion - Select all given selector
Nobody has claimed this yet.
- Dominant language
- Cython
- Stars
- 1.7k
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
I admire this amazing package where it has helped me both with work and also better knowledge! Its amazing!
I would like to give a suggestion and maybe this already has this function without me knowing it but I was thinking if there is a possibility to do a sort of selection of selectors. etc (Which I got inspiration from bs4):
selector= SoupStrainer(["h1", "a"])
bs4 = soup(response.text, 'lxml', parse_only=strainer)
what it basically does, instead of having the whole HTML printed out, it only prints out all that contains h1 & a in this case which saves more resources instead of needing to pull out the whole HTML everytime to scrape. If this is a possibility of course?
Admire your work!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing selector and parsing entry points related to SoupStrainer, soup(response.text, 'lxml', parse_only=strainer), and CSS selectors. Done should allow a selector collection such as ["h1", "a"] to limit parsed HTML to matching elements, with tests covering that example and excluding unrelated content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100