import requests
from bs4 import BeautifulSoup
# HOST = 'https://rarible.com/'
URL = 'https://foundation.app/profiles?sortBy=users_sort_total_vol_desc'
HEADERS = {
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36 OPR/83.0.4254.46 (Edition Yx GX)'
}
def get_html(url, params=''):
r = requests.get(url, timeout=30, headers=HEADERS, params=params)
return r
def get_content(html):
soup = BeautifulSoup(html, 'html.parser')
items = soup.find_all('div', class_='st--c-cKuOtG st--c-cKuOtG-jAWrS-isInteractive-true st--c-cKuOtG-itrBUU-css')
autors = []
for item in items:
autors.append(
{
'title': item.find('div', class_='st--c-PJLV st--c-tRNlc st--c-PJLV-iPjgmb-css').get.text()
}
)
return autors
html = get_html(URL)
print(get_content(html.text))