0

OKay, I've got this problem with using xpath and headless in chromedriver. it works when i run it with non-headless but gives

 raise exception_class(message, screen, stacktrace)
 selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="discussion-list-5f9f8b4c804455f9f8b4c722e121"]/table/tbody/tr[1]/th/div/a"}

i have

time.sleep(30)

ca = driver.find_element_by_xpath('//*[@id="discussion-list-5f9f8b4c804455f9f8b4c722e121"]/table/tbody/tr[1]/th/div/a').get_attribute('title')
print(ca)`

I saw everyone saying to add in

    chrome_options.add_argument("--headless")
    chrome_options.add_argument("window-size=1080x720")

but that's not working. :-/

0 Answers0