Clicking “More” button via selenium

前端 未结 3 1985
借酒劲吻你
借酒劲吻你 2020-12-22 11:01

I am trying to scrape the following website : https://angel.co/companies

There is a \"More\" button at the bottom, which on click loads more records.

I need

3条回答
  •  北海茫月
    2020-12-22 11:31

    I have tried the same using Java. Please add explicit/fluent wait before checking the list size. Please find below the code.

    driver.get("https://angel.co/companies");
        new WebDriverWait(driver, 30).pollingEvery(Duration.ofMillis(100)).withTimeout(Duration.ofSeconds(30))
                .until(ExpectedConditions.elementToBeClickable(By.cssSelector("div.more")));
        List elements = driver.findElements(By.cssSelector("div.more"));
        System.out.println(elements.size());
    

提交回复
热议问题