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

Suggestion - Select all given selector #30

Open
BarryThrill opened this issue Oct 6, 2020 · 5 comments
Open

Suggestion - Select all given selector #30

BarryThrill opened this issue Oct 6, 2020 · 5 comments

Comments

@BarryThrill
Copy link
Contributor

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!

@rushter
Copy link
Owner

rushter commented Oct 6, 2020

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.

@BarryThrill
Copy link
Contributor Author

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! :)

@rushter
Copy link
Owner

rushter commented Oct 6, 2020

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

@BarryThrill
Copy link
Contributor Author

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? 😁

@rushter
Copy link
Owner

rushter commented Dec 18, 2020

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants