Professional Documents
Culture Documents
Webscrapping
Webscrapping
import requests
from bs4 import BeautifulSoup
import csv
url = "https://finance.yahoo.com/crypto/"
response = requests.get(url)
crypto_data = []
rows = table.find_all("tr")[1:11]
for row in rows:
data = row.find_all("td")
name = data[0].text.strip()
price = data[1].text.strip()
change = data[2].text.strip()
percent_change = data[3].text.strip()
market_cap = data[4].text.strip()
volume_in_currency = data[5].text.strip()
circulating_supply = data[6].text.strip()
crypto_data.append([name, price, change, percent_change,
market_cap, volume_in_currency, circulating_supply])