from bs4 import BeautifulSoup as BS
import requests
def obtain_price(link):
info = requests.get(link)
soup = BS(info.text, 'html.parser')
price = soup.find("div", class_ ="BNeawe iBp4i AP7Wnd").text
return price
link = "https://www.google.com /search?q = bitcoin + price"#link to bitcoin price
price = obtain_price(link)
print(price)
Comments
Leave a comment