Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <p onclick="window.location.href = 'https://www.blahblah.com/somenumbers'">
- some blah blah text
- </p>
- <p> irrelevant text </p>
- >>> from bs4 import BeautifulSoup
- >>> import re
- >>>
- >>> soup = BeautifulSoup('<p> blabla</p> and <p onclick="js action">blabla</p>')
- >>> soup.find_all('p', onclick=re.compile('.'))
- [<p onclick="js action">blabla</p>]
- plist = soup.select('p[onclick]')
Add Comment
Please, Sign In to add comment