lundi 2 janvier 2017

How to simulate clicking on "Next" until the end?

I am not sure how to simulate clicking the "Next", my current code will just stop at first instance..I also created a for loop but it would just say object is not iterable..any way to revise my code?

from selenium import webdriver
browser = webdriver.Firefox()
import time
browser.get('http://ift.tt/2iYZjJt')

linkElem = browser.find_element_by_css_selector("#pag > a")
type(linkElem)
linkElem.click() # follows the "Next" link

Aucun commentaire:

Enregistrer un commentaire