Advertisement
yasi04

Untitled

Apr 20th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. from bs4 import BeautifulSoup
  2. from fake_useragent import UserAgent
  3. import requests
  4.  
  5.  
  6. class LoliSamurai:
  7. def Parse() -> None:
  8. ua = UserAgent()
  9. headers = {'User-Agent': f'{ua.random}'}
  10. url = 'https://vk.com/lolisamurai1'
  11. response = requests.get(url, headers=headers)
  12. soup = BeautifulSoup(response.content, 'html.parser')
  13. element = soup.find_all("div", class_="wall_post_text")
  14. print(element)
  15. # element = soup.find("div", class_="wall_post_text")
  16. # print(element.text)
  17. # element = soup.find("img")
  18. # print(element.get("src"))
  19.  
  20.  
  21. if __name__ == "__main__":
  22. LoliSamurai.Parse()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement