Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup
- s = "<blockquote><i>Quote</i></blockquote><br />text <h3>This is a title</h3>"
- soup = BeautifulSoup(s, "html.parser")
- soup_all = soup.findAll()
- for s in soup.strings:
- print get_tags_by_string(s)
- Quote -> blockquote & i
- text -> None
- This is a title -> h3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement