question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion: adding soupsieve.strain

See original GitHub issue

Hello @facelessuser,

I need to create BeautifulSoup strainers to optimize scrapers for my tool here. But as a convenience for my users, I am going to build them from simple css selectors such as li.item[align=left].

I can do so by using your CSSParser class that processes and return Selector instances and assess whether the selector is simple enough to befit a strainer. If so, I can build a function that will “apply” this selector to tell the strainer whether it should parse the current node etc.

I will implement this for me in my tool but I was wondering if you’d like me to contribute to this lib instead by adding something like soupsieve.strain basically. It would return an arg (typically a function) you can give to bs4.SoupStrainer and should raise a custom error if the selector is found to be too complex for the task. If this is of any interest I can open a PR for this.

Have a good day and thanks for your work,

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:29 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
facelessusercommented, Mar 23, 2021

@gir-bot remove S: triage @gir-bot add T: feature

0reactions
facelessusercommented, Sep 10, 2021

It seems that this issue is now stale. Closing for housekeeping. If this is desired in the future, we can reopen and continue discussing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How-to: Submit a Strain Suggestion?
The more submissions a strain receives, the more likely it is that we'll add it to our strain database permanently. If you have...
Read more >
Adding and using a custom waveform in PyCBC Inference
Learn how to use PyCBC to analyze gravitational-wave data and do parameter inference. - PyCBC-Tutorials/inference_7_AddingCustomWaveform.ipynb at master ...
Read more >
Weeds in Paths? Use Vinegar, Not Roundup
The weed sounds absolutely dreadful. From a Florida gardening forum I visited, the recommendation is to apply a pre-emergent herbicide (maybe ...
Read more >
Building A Marijuana Strain Recommendation System ...
Finding similar strains​​ To find an actual recommendation, we first need to create a fake user that is interested in some recommendations: user_ ......
Read more >
Smoking Dope with Thomas Pynchon
That Pynchon was camera shy added to the mystique: he actually lived by the Joycean ethic of "silence, exile, and cunning"! Unlike Kerouac,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found