when i run headless = True i get this error JavascriptException: Message: javascript error: {“status”:60,”value”:”[object HTMLButtonElement] has no size and location”}
(Session info: chrome-headless-shell=124.0.6367.119)
but works fine when headless = False
can some one fix the issue in my script, I am trying to webscrape below is the code where error triggers
try:
select_store = driver.find_element(By.XPATH,’//button[@class=”cc-btn cc-btn–secondaryC js-selectStore”][@data-storename=”FIRENZE NOVOLI”]’)
driver.implicitly_wait(10)
driver.save_screenshot(‘click7.png’)
ActionChains(driver).move_to_element(select_store).click(select_store).perform()
driver.save_screenshot(‘click8.png’)
except StaleElementReferenceException as e:
driver.save_screenshot(‘click9.png’)
select_store = driver.find_element(By.XPATH,’//button[@class=”cc-btn cc-btn–secondaryC js-selectStore”][@data-storename=”FIRENZE NOVOLI”]’)
driver.implicitly_wait(10)
driver.save_screenshot(‘click10.png’)
ActionChains(driver).move_to_element(select_store).click(select_store).perform()
driver.implicitly_wait(10)
driver.save_screenshot(‘click11.png’)
I am trying to run code in headless= true without error
Akshay Shinde is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.