Guest User

Untitled

a guest
Jun 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. <a href="website" target="_blank" rel="nofollow" onmouseover="ddrivetip('<em>Thu, 21 Jun 2018</em> <br/> Disappointed coach Bert van Marwijk said Australia have to find the last part of the puzzle if they are to stay in the World Cup after a 1-1 draw with Denmark on Thursday. Australia captain Mile Jedinak hit a VAR-assisted penalty to earn the Socceroos first point in Russia after Christian Eriksens opener, giving Australia []')" ;="" onmouseout="hideddrivetip()">Australias Van Marwijk says last part of puzzle missing at World Cup</a>
  2.  
  3. from bs4 import BeautifulSoup
  4.  
  5. html = """
  6. <a href="website"
  7. target="_blank"
  8. rel="nofollow"
  9. onmouseover="ddrivetip('<em>Thu, 21 Jun 2018</em> <br/> Disappointed coach Bert van Marwijk said Australia have to find the last part of the puzzle if they are to stay in the World Cup after a 1-1 draw with Denmark on Thursday. Australia captain Mile Jedinak hit a VAR-assisted penalty to earn the Socceroos first point in Russia after Christian Eriksens opener, giving Australia []')" ;=""
  10. onmouseout="hideddrivetip()">
  11. Australias Van Marwijk says last part of puzzle missing at World Cup
  12. </a>
  13. """
  14.  
  15. soup = BeautifulSoup(html, 'lxml')
  16.  
  17. for a in soup.find_all('a'):
  18. print(a.text)
  19.  
  20. Australias Van Marwijk says last part of puzzle missing at World Cup
  21.  
  22. from bs4 import BeautifulSoup
  23. s = """<a href="website" target="_blank" rel="nofollow" onmouseover="ddrivetip('<em>Thu, 21 Jun 2018</em> <br/> Disappointed coach Bert van Marwijk said Australia have to find the last part of the puzzle if they are to stay in the World Cup after a 1-1 draw with Denmark on Thursday. Australia captain Mile Jedinak hit a VAR-assisted penalty to earn the Socceroos first point in Russia after Christian Eriksens opener, giving Australia []')" ;="" onmouseout="hideddrivetip()">Australias Van Marwijk says last part of puzzle missing at World Cup</a>"""
  24. soup = BeautifulSoup(s, "html.parser")
  25. print(soup.a.attrs['onmouseover'])
Add Comment
Please, Sign In to add comment