una mas
This commit is contained in:
@ -220,14 +220,14 @@ def search_indice(indice):
|
||||
price = soup.find("div", {"data-test": "instrument-price-last"})
|
||||
price_change = soup.find("span", {"data-test": "instrument-price-change"})
|
||||
price_change_percent = soup.find("span", {"data-test": "instrument-price-change-percent"})
|
||||
|
||||
porcentaje = price_change_percent.text.strip().replace("(", "").replace(")", "").replace("%", "")
|
||||
|
||||
if price and price_change and price_change_percent:
|
||||
data = {
|
||||
"indice": indice,
|
||||
"valorActual": price.text.replace(",", "").strip(), # Convertir a número
|
||||
"cambio": price_change.text.replace(",", "").strip(), # Convertir a número
|
||||
"porcentaje": price_change_percent.text.strip().replace("(", "").replace(")", "") # Eliminar paréntesis
|
||||
"porcentaje": porcentaje # Eliminar paréntesis
|
||||
}
|
||||
logging.info(data)
|
||||
# Enviar los datos al bot de Telegram
|
||||
|
Reference in New Issue
Block a user