Skip to content

Instantly share code, notes, and snippets.

View mattvpham's full-sized avatar

Matthew Pham mattvpham

View GitHub Profile
@mattvpham
mattvpham / scraper.py
Created July 11, 2013 02:09
Simple python scraper using Mechanize and BeautifulSoup.
from bs4 import BeautifulSoup
import mechanize
if __name__ == '__main__':
response = mechanize.urlopen("http://fd2-www.leclercdrive.fr/031801/courses/pgeWMEL009_Courses.aspx")
soup = BeautifulSoup(response.read())
products = soup.find_all('div', 'divPrdContaineur')
for product in products:
name1 = product.find('div', 'divLibelle1').string
name2 = product.find('div', 'divLibelle2').string