import requests
from bs4 import BeautifulSoup
url = 'https://coinmarketcap.com/'
r = requests.get(url)
soup = BeautifulSoup(r.text, 'lxml')
all = soup.find_all('',class_='cmc-table-row')
for x in all:
rank = x.find('td',class_='cmc-table__cell--sort-by__rank').text
name = x.find('td',class_='cmc-table__cell--sort-by__name').text
market_cap = x.find('td',class_='cmc-table__cell--sort-by__market-cap').text
price = x.find('td',class_='cmc-table__cell--sort-by__price').text
volume = x.find('td',class_='cmc-table__cell--sort-by__volume-24-h').text
circulating_supply = x.find('td',class_='cmc-table__cell--sort-by__circulating-supply').text
change = x.find('td',class_='cmc-table__cell--sort-by__percent-change-24-h').text
print(f'{rank} {name} {market_cap} {price} {volume} {circulating_supply} {change}')
import requests
from bs4 import BeautifulSoup
url = 'https://coinmarketcap.com/'
r = requests.get(url)
soup = BeautifulSoup(r.text, 'lxml')
all = soup.find_all('',class_='cmc-table-row')
for x in all:
rank = x.find('td',class_='rc-table-cell table-col-rank rc-table-cell-fix-left').text
name = x.find('a',class_='cmc-link').find('p').text
market_cap = x.find('td',class_='rc-table-cell font_weight_500___2Lmmi').text
price = x.find('td',class_='rc-table-cell font_weight_500___2Lmmi').text
volume = x.find('div',class_='Box-sc-16r8icm-0 sc-1anvaoh-0 gxonsA').a.p.text
circulating_supply = x.find('p',class_='Text-sc-1eb5slv-0 kqPMfR').text
# change = x.find('td',class_='cmc-table__cell--sort-by__percent-change-24-h').text
print(f'{rank} {name} {market_cap} {price} {volume} {circulating_supply}')