Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Last active March 23, 2018 19:26
Show Gist options
  • Save sergiolucero/59f6f629389a31e2b1c819a0ce8a441f to your computer and use it in GitHub Desktop.
Save sergiolucero/59f6f629389a31e2b1c819a0ce8a441f to your computer and use it in GitHub Desktop.
scraping mercantil
import time
from bs4 import BeautifulSoup
from selenium import webdriver
base_url='https://www.mercantil.com/restaurantes/1502/'
driver = webdriver.Firefox()
driver.get(base_url)
for item in range(10):
driver.find_element_by_class_name('more').click()
time.sleep(5)
bs = BeautifulSoup(driver.page_source)
links = bs.find_all('div', {'class': 'cont_title_detalle'})
print(len(links))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment