Selenium-Debugging: Element is not clickable at point (X,Y)

前端 未结 5 1076
傲寒
傲寒 2020-11-30 19:38

I try to scrape this site by Selenium.

I want to click in \"Next Page\" buttom, for this I do:

 driver.find_element_by_class_name(\'pagination-r\').c         


        
5条回答
  •  借酒劲吻你
    2020-11-30 20:21

    If you are receiving an element not clickable error, even after using wait on the element, try one of these workarounds:

    • Use Action to move to the location of element and then run perform on action
    WebElement element = driver.findElement(By("element_path"));
    Actions actions = new Actions(driver);
    actions.moveToElement(element).click().perform();`
    
    • Check for an overlay or spinner on the element and wait for its invisibility
    By spinnerimg = By.id("spinner ID");
    WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
    wait.until(ExpectedConditions.invisibilityOfElementLocated(spinnerimg ));
    

    Hope this helps

提交回复
热议问题