just want to share this tip that took me a while to figure out.
If it looks like your program is freezing in headless mode:
- the driver resolution might be super small
- take a screenshot just before it says no elements found:
driver.get_screenshot_as_file('screenshot.png')
I found out my driver resolution was like a mobile phone resolution so all the elements were scattered around and unable to be found
this will fix it:
options = webdriver.ChromeOptions()
options.add_argument("--window-size=1920,1080")
If it looks like your program is freezing in headless mode:
- the driver resolution might be super small
- take a screenshot just before it says no elements found:
driver.get_screenshot_as_file('screenshot.png')
I found out my driver resolution was like a mobile phone resolution so all the elements were scattered around and unable to be found
this will fix it:
options = webdriver.ChromeOptions()
options.add_argument("--window-size=1920,1080")
Statistics: Posted by Pirkka — Wed Sep 11, 2024 12:46 pm