I am Writing a Script for automation purposes. The Selenium driver wont update the page number, so the driver can proceed to the next page number.
sample.py
number_to_loop_over = 5
page = number_to_loop_over
while True:
if page != 0:
#page must be string so driver can be executed
driver.get(driver.current_url +str(page))
page = page - 1
if page == 0:
break
Problem :
str(page), is not been replaced once thecurrent_urlis called; instead this is what's happening :
(current_url123)
- once the
current_urlis called for the first time,1gets inserted, but if called again,str(page)gets appended beside the previous number.