I am trying to extract the url's for each restaurant from this page and I have written a python script for the same:
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
browser = webdriver.Firefox()
browser.get("http://www.delyver.com/Partners/partner/HSR%20Layout,%20Bengaluru,%20Karnataka,%20India/12.9081357/77.64760799999999")
time.sleep(1)
elem = browser.find_element_by_tag_name("body")
no_of_pagedowns = 40
while no_of_pagedowns:
elem.send_keys(Keys.PAGE_DOWN)
time.sleep(0.2)
no_of_pagedowns-=1
post1 = browser.find_elements_by_css_selector("Parwrsp.Parwrsp-Ado")
for post in post1:
print post.get('href')
When i run the script, the browser window opens and i maximize its window size to obtain focus and it automatically scrolls down. But nothing gets printed. I implemented selenium following this link.
What am i doing wrong?