Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3.  
  4. #getting the html code of the page from the url
  5. url = "https://www.youtube.com/watch?v=bHkQb3gnSRA"
  6. r = requests.get(url)
  7. #print(r.content)
  8.  
  9. #making it usable by BeautifulSoup
  10. soup = BeautifulSoup(r.content, "lxml")
  11. #print(soup.prettify())
  12.  
  13. likes = soup.find_all("a", {"class": "yt-simple-endpoint"})
  14. print(likes)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement