Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74074

how to use selenium in a page that doesn`t ever load completely?

$
0
0

I was trying to get some elements from this page: https://www.humblebundle.com/store/shadowgrounds-survivor so I could do something with them. When I inspected the page from Chrome or Firefox I would get every element in the page, or at least I thought so, but when trying to find the element with selenium it just didn't.

I realised the page was loading forever so I need to know if there's any possible way to do something with selenium even if the page isn't fully loaded.

This is my code:

public static void main(String[] args) throws IOException, InterruptedException {
    System.setProperty("webdriver.gecko.driver", "C:\\WebDriver\\bin\\geckodriver.exe");
    DesiredCapabilities capabilities = DesiredCapabilities.firefox();
    capabilities.setCapability("marionette", true);
    WebDriver driver = new FirefoxDriver(capabilities);

    try {
        driver.get("https://www.humblebundle.com/store/shadowgrounds-survivor");
        WebElement listElement1 = driver.findElement(By.tagName(".current-price"));

    } finally {
        driver.close();
    }
}

I get the NoSuchElementException from selenium.


Viewing all articles
Browse latest Browse all 74074

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>