soup icon indicating copy to clipboard operation
soup copied to clipboard

Anything akin to BeautifulSoup's Comment?

Open mtslzr opened this issue 4 years ago • 1 comments

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?

mtslzr avatar Sep 23 '20 03:09 mtslzr

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

anaskhan96 avatar Sep 23 '20 16:09 anaskhan96