i want to save screenshots of a webpage, and i find the code
display = Display(visible=0, size=(800, 600))
try:
display.start()
browser = webdriver.Firefox()
try:
browser.get(some_url)
browser.save_screenshot(filename)
finally:
browser.quit()
finally:
display.stop()
runs well like said in https://www.pythonanywhere.com/forums/topic/1192/#id_post_8360
but things went wrong when i just added @app.route(some_route)
in front of the function with an exception
WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
could anyone tell me what happened? the python version is 2.7