0

So the page in question is here, I want to navigate pagination having following markup:

 <li class="btn-next">
<a href="javascript:ctrl.set_pageReload(2)">Suivant</a></li>

If you notice, JS method is being called here. So far I have done this:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


driver = None
driver = webdriver.Firefox()
wait = WebDriverWait(driver, 30)


def fetch(url):
    driver.get(
        'http://www.leparking.fr/voiture-occasion/Porsche--targa-g.html#!/voiture-occasion/Porsche--targa-g.html%3Fslider_millesime%3D1940%7C1985')

    elem_more = wait.until(EC.element_to_be_clickable((By.LINK_TEXT, "Suivant")))
    elem_more.click()


fetch(None)

It does hover the element but does not navigate on click. What should I do?

Thanks

1 Answer 1

1

I sorted it out by using execute_script method:

elem_more = wait.until(EC.element_to_be_clickable((By.LINK_TEXT, "Suivant")))
driver.execute_script("arguments[0].click();", elem_more)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.