Skip to content

Suggestion - Select all given selector #30

Open

Description

@BarryThrill

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!

Activity

  1. rushter commented on Oct 6, 2020

    @rushter
    Owner

    Hi, I don't think this is possible on my side. Modest library does not have support for it, we need to modify the C parser first.
    I could be wrong, I haven't looked at Modest source code for a long time.

  2. BarryThrill commented on Oct 6, 2020

    @BarryThrill
    ContributorAuthor

    Hi, I don't think this is possible on my side. Modest library does not have support for it, we need to modify the C parser first.
    I could be wrong, I haven't looked at Modest source code for a long time.

    Ah crap :( That would be a cool feature but of course, no point if it will take you lots of time and also if you dont see a reason to do it aswell. Still appreciate what you have done here! :)

  3. rushter commented on Oct 6, 2020

    @rushter
    Owner

    Yeah, it's a good feature, so let's keep the issue open.

  4. BarryThrill commented on Dec 11, 2020

    @BarryThrill
    ContributorAuthor

    Hi @rushter! I hope you are doing well and staying safe!

    I just wanted to check with you if you had any chance to look at it? 😁

  5. rushter commented on Dec 18, 2020

    @rushter
    Owner

    Sorry, I don't have time to look at this right now. This is a pretty big task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions