Created
May 17, 2017 03:22
-
-
Save DavidVentura/d83c502e9fe3e9cd0711cda792bafa33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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