Guest User

Untitled

a guest
Nov 21st, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. $text = "meu nome é <strong>Wallace</strong>";
  2.  
  3. strip_tags($text); // 'meu nome é Wallace'
  4.  
  5. import re
  6.  
  7. text = 'meu nome é <strong>Wallace</strong>'
  8. text = re.sub('<[^>]+?>', '', text)
  9. print(text)
  10.  
  11. >>> from bs4 import BeautifulSoup as bs
  12. >>> bs('<p>hey<span> brrh </span>lolol', 'html.parser').text
  13. 'hey brrh lolol'
  14.  
  15. pip install --upgrade beautifulsoup4
Add Comment
Please, Sign In to add comment