Код: Выделить всё
import requests
from bs4 import BeautifulSoup
def stockprice(stock_ticker):
url = "https://finance.yahoo.com/quote/" + str(stock_ticker) + "?p=" + str(stock_ticker) + "&.tsrc=fin-srch"
print(url)
r = requests.get(url)
soup = BeautifulSoup(r.text, 'html.parser')
price = soup.find('fin-streamer', {"class": 'Fw(b) Fz(36px) Mb(-4px) D(ib)'}).text
print(price)
stockprice("ISPA.DE")
Подробнее здесь: https://stackoverflow.com/questions/779 ... rk-but-one