Im sorry im new to coding but im really trying to learn.Im not able to pass the value i want, wich in this case is just a number i want to scrape from the web.
The problem it's that im not able no pass the value i scrape with beatifulsoup to a csv file,can any kind person help me with this?
from bs4 import BeautifulSoup
from urllib.request import Request, urlopen
import csv
req = Request('https://www.infodolar.com.mx/tipo-de-cambio-dof-diario-oficial-de-la-federacion.aspx', headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36'})
html_page = urlopen(req).read()
soup = BeautifulSoup(html_page,'html.parser')
Dollar = soup.find('td','colCompraVenta')
print (Dollar.text)
file=open('New.csv', 'wb')
writer = csv.writer(file)
writer.writerows([Dollar.encode('utf-8')])
file.close()