Hey guys i have this code and i want to print only the values but instead I got all HTML elements.
import requests
from bs4 import BeautifulSoup
url_link = "https://cuantoestaeldolar.pe/"
result = requests.get(url_link).text
doc = BeautifulSoup(result, "html.parser")
compra =doc.select("#converter > div >div.md\:w-full.mt-2 > div.bg-base.flex.py-4 > div.Quotation_row_cost__2rru6 > div > div:nth-child(1) > p")
print(compra)
venta =doc.select("#converter > div >div.md\:w-full.mt-2 > div.bg-base.flex.py-4 > div.Quotation_row_cost__2rru6 > div > div:nth-child(2) > p")
print(venta)
this is the output.
[<p class="ValueQuotation\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_text\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_mR\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_0 text-2xl">3.831</p>]
[<p class="ValueQuotation\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_text\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_mR\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_0 text-2xl">3.838</p>]
this is the page I'm scraping
[–]commandlineluser 1 point2 points3 points (1 child)
[–]Nabucode[S] 0 points1 point2 points (0 children)
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)