Advertisement
egorfake

Untitled

Oct 2nd, 2022
850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3.  
  4. HOST = 'https://rifme.net/'
  5. URL = 'https://rifme.net/r/%D0%BC%D0%B8%D1%80/0'
  6.  
  7. HEADERS = {
  8.     'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
  9.     'user-agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0'
  10. }
  11.  
  12. def get_html(url, params=''):
  13.     r = requests.get(url, headers=HEADERS, params=params)
  14.     return r
  15.  
  16.  
  17. get_html(URL)
  18.  
  19. #
  20. # html = get_html(URL)
  21. #
  22. # response = requests.get(URL)
  23. # soup = BeautifulSoup(get_html(URL), 'lxml')
  24. #
  25. # print(soup)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement