Skip to content

Instantly share code, notes, and snippets.

@adrianjguerrero
Created May 31, 2020 02:08
Show Gist options
  • Save adrianjguerrero/a745a7dba18a15b1e887af94a3bec297 to your computer and use it in GitHub Desktop.
Save adrianjguerrero/a745a7dba18a15b1e887af94a3bec297 to your computer and use it in GitHub Desktop.
from bs4 import BeautifulSoup
import requests
url = 'http://www.bcv.org.ve/estadisticas/tipo-de-cambio'
response = requests.get(url)
html = BeautifulSoup(response.text, 'html.parser')
tasa_bcv = html.select_one('#dolar strong').get_text()
tasa_bcv = float(tasa_bcv.replace('.','').replace(',','.'))
precio_gasolina = tasa_bcv * 0.5
print(precio_gasolina)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment