I can't access a specific element of a webpage with Selenium in Java.
I need to access the "sign in" option inside of a submenu of the Trading View webpage.
I tried xPath, CSS selector, etc. but nothing works, I guess it's inside some kind of subdivision of the webpage I don't know, but I'm positive it's not an <iframe>
, I have already checked that. I could be wrong though.
My code:
public class Main {
public static void main(String[] args){
System.setProperty("webdriver.opera.driver","C:\\Documents\\LIBRARIES\\Opera Driver\\operadriver.exe");
WebDriver driver = new OperaDriver();
driver.get("https://www.tradingview.com");
driver.manage().timeouts().scriptTimeout(Duration.ofSeconds(4));
driver.findElement(By.xpath(("/html/body/div[2]/div[3]/div[2]/div[3]/button[1]"))).click();
driver.manage().timeouts().scriptTimeout(Duration.ofSeconds(4));
// This is where I need to select the element of the webpage, nothing works so far (Xpath, CSS, ID...)
}
}