soup
soup copied to clipboard
Anything akin to BeautifulSoup's Comment?
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?
It's not there currently, but could definitely be a useful feature You're welcome to submit a PR :)