Skip to content

Instantly share code, notes, and snippets.

@DavidVentura
Created May 17, 2017 03:22
Show Gist options
  • Save DavidVentura/d83c502e9fe3e9cd0711cda792bafa33 to your computer and use it in GitHub Desktop.
Save DavidVentura/d83c502e9fe3e9cd0711cda792bafa33 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import csv
import requests
from bs4 import BeautifulSoup
f = open("dalmo.csv", "w")
csvwriter = csv.writer(f)
r = requests.post("http://www.acara.org.ar/guiaprecios/ver_precios.php", data={ "marID": '0' })
soup = BeautifulSoup(r.text, 'html.parser')
for table in soup.find_all("table", class_="texto12"):
for row in table.find_all("tr"):
d = [ data.text.strip() for data in row.find_all("td") ]
csvwriter.writerow(d)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment