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

Anything akin to BeautifulSoup's Comment? #62

Open
mtslzr opened this issue Sep 23, 2020 · 1 comment
Open

Anything akin to BeautifulSoup's Comment? #62

mtslzr opened this issue Sep 23, 2020 · 1 comment

Comments

@mtslzr
Copy link

mtslzr commented Sep 23, 2020

Just curious if soup has anything similar to how BeautifulSoup lets your parse HTML comments in Python?

https://www.crummy.com/software/BeautifulSoup/bs4/doc/#comments-and-other-special-strings

Trying to parse some HTML where some data is commented, and able to do the following in Python:

from bs4 import BeautifulSoup, Comment
comments = soup.find_all(text=lambda text: isinstance(text, Comment))
comments_soup = BeautifulSoup(comment, 'lxml')

Is there anything close to that here? Or any chance or adding something like it?

@anaskhan96
Copy link
Owner

It's not there currently, but could definitely be a useful feature
You're welcome to submit a PR :)

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

No branches or pull requests

2 participants