I have some oddsportal parsing app, that works perfectly on localhost, but when I upload it to heroku, it can't find an element by xpath.
It goes to the page with driver.get("url")(chrome and chromedriver are installed), i can see in logs currentUrl, but then it just doesn't see elements
I've tried Thread.sleep(n) where n was even 120 seconds, have tried
WebDriverWait wait = new WebDriverWait(driver, 120); Nothing helps
Snippet of code:
options.setBinary("/app/.apt/usr/bin/google-chrome");
System.setProperty("webdriver.chrome.driver","/app/.chromedriver/bin/chromedriver");
WebDriver driver = new ChromeDriver(options);
driver.get("https://www.oddsportal.com/results/#soccer");
WebDriverWait wait = new WebDriverWait(driver, 120);
element = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//a[@href='/soccer/austria/tipico-bundesliga/results/']")));
element.click();
Page opens when i use it on localhost, but
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element:{"method":"xpath","selector":"//a[@href='/basketball/usa/nba/results/']"}
in logs on heroku