Hi, I'm fairly new to Selenium. I managed to start browser etc. Then I wanted to click "Accept" cookies button from
google.com. Icopied it's xpath from inspect:
xpath is //*[@id="L2AGLb"]
This is what it looks......
browser.find_element(By.XPATH, "//*[@id="L2AGLb"]")
SyntaxError: invalid syntax. Perhaps you forgot a comma?
find_element(By.XPATH, //*[@id="L2AGLb"])
SyntaxError: invalid syntax
find_element(By.XPATH, //*[@id="L2AGLb"])
SyntaxError: invalid syntax
browser.find_element(By.XPATH("//*[@id="L2AGLb"]")
SyntaxError: invalid syntax. Perhaps you forgot a comma?
browser.find_element(By.XPATH(//*[@id="L2AGLb"])
SyntaxError: invalid syntax
browser.find_element(By.XPATH("//*[@id="L2AGLb"]");
SyntaxError: invalid syntax. Perhaps you forgot a comma?
browser.find_element(By.XPATH("//*[@id="L2AGLb"]"));
SyntaxError: invalid syntax. Perhaps you forgot a comma?
dateBox = driver.find_element_by_xpath("//*[@id="L2AGLb"]")
SyntaxError: invalid syntax. Perhaps you forgot a comma?
dateBox = browser.find_element_by_xpath("//*[@id="L2AGLb"]")
SyntaxError: invalid syntax. Perhaps you forgot a comma?
browser.find_element_by_xpath("//*[@id="L2AGLb"]")
SyntaxError: invalid syntax. Perhaps you forgot a comma?
I tried like everything and have no idea what's wrong 🙄