Forums

Troubleshoot selenium chrome page crash

This code was working fine on my computer. I attempted to run on pythonanywhere and has challenges on the error because of page crash with error message below. Selenium was initially work until this step which any action would lead to page crash. What are potential cause of page crash? Where are log that I can investigate this sort of crash? Is it because of limit system resources?

print(driver.page_source()) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/kitsupni/vmyshop/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 679, in page_source return self.execute(Command.GET_PAGE_SOURCE)['value'] File "/home/kitsupni/vmyshop/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/home/kitsupni/vmyshop/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: session deleted because of page crash from tab crashed (Session info: headless chrome=90.0.4430.212)

Thanks, Kit

How does your code look like? Are you following https://help.pythonanywhere.com/pages/selenium/ ?

Yes. I did follow. It work until the login step that I attempted to automted. The last line that is working is "loginbutt.click()". After that, any execution involve the page or object on the page will cause page crash. Per code below, when finding element is attempt the page will crash. I did try to just print(drive.page_source()), page is also crashed. Please suggest way to diagnos.

Regards, Kit

.....[All necessary modules are imported]....

options = webdriver.ChromeOptions() options.add_argument("--headless") options.add_argument("--disable-gpu") prefs = {'profile.default_content_settings.popups': 0, 'download.default_directory': downloaddir} options.add_experimental_option('prefs', prefs)

`driver=webdriver.Chrome('chromedriver',options=options) driver.get("https://account.line.biz/login?redirectUri=https%3A%2F%2Foaplus.line.biz%2F")

linebizacctbutt=driver.find_element_by_class_name('btn.btn-lg.btn-block.btn-dark') linebizacctbutt.click() email=driver.find_element_by_name("email") email.send_keys(username) password=driver.find_element_by_name("password") password.send_keys(password) loginbutt=driver.find_element_by_class_name('btn.btn-lg.btn-block.btn-dark') loginbutt.click()

shopcontainers=driver.find_elements_by_class_name('jv-card-container.ac-account-item-container') actions=ActionChains(driver) actions.move_to_element(shopcontainers[3]) actions.click(shopcontainers[3]) actions.perform()`

It's crashing on print in your initial post. Is it crashing the same way on click? Do you put that print before click?