daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Mar 21st, 2019 38 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top