Skip to main content
added 78 characters in body
Source Link
Prophet
  • 33.5k
  • 29
  • 58
  • 90

When using headless mode you should set the screen size since default screen size in headless mode is 800x600.
That's why in headless mode you have the ElementClickInterceptedException error for the code that is running fine in the regular mode.
So, try adding

options.add_argument("--window-size=1920x1080")

Also, we usually add this:

options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')

When using headless mode you should set the screen size since default screen size in headless mode is 800x600.
That's why in headless mode you have the ElementClickInterceptedException error for the code that is running fine in the regular mode.
So, try adding

options.add_argument("--window-size=1920x1080")

When using headless mode you should set the screen size since default screen size in headless mode is 800x600.
That's why in headless mode you have the ElementClickInterceptedException error for the code that is running fine in the regular mode.
So, try adding

options.add_argument("--window-size=1920x1080")

Also, we usually add this:

options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
Source Link
Prophet
  • 33.5k
  • 29
  • 58
  • 90

When using headless mode you should set the screen size since default screen size in headless mode is 800x600.
That's why in headless mode you have the ElementClickInterceptedException error for the code that is running fine in the regular mode.
So, try adding

options.add_argument("--window-size=1920x1080")