Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. from bs4 import BeautifulSoup
  2. s = "<blockquote><i>Quote</i></blockquote><br />text <h3>This is a title</h3>"
  3. soup = BeautifulSoup(s, "html.parser")
  4. soup_all = soup.findAll()
  5. for s in soup.strings:
  6. print get_tags_by_string(s)
  7.  
  8. Quote -> blockquote & i
  9. text -> None
  10. This is a title -> h3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement