rushter / rushter/selectolax

Suggestion - Select all given selector

Open
#30 5 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.