Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure the compatibility of retrieving the Google Drive home page with Selenium using the "check_and_gen.py" script on Ubuntu 20.04 with the Chromium/Canonical Snap distribution #342

Merged
merged 1 commit into from
May 22, 2022

Conversation

marin-m
Copy link
Contributor

@marin-m marin-m commented May 22, 2022

Hello,

This pull request fixes two bugs:

  1. When running the "check_and_gen.py" script on Ubuntu 20.04 with Chromium 101 installed from the standard Ubuntu Snap package, the script was crashing at the Fetching Drive homepage... step with the following error message:
selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist 

It was due to the fact that when using the Chromium binary located at /snap/bin/chromium, the /tmp directory is made available at a different place, which causes incompatibility with Selenium.

This was fixed by changing the executable names at which a valid Chromedriver binary can be found, adding chromium.chromedriver in addition to chromedriver which was already checked for, as this solves the issue as explained here: https://stackoverflow.com/questions/64992087/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t

  1. After solving the first issue, the concerned step of fetching the Google Drive home page was still not succeeding due to another error:
selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from renderer: 298,708

This was due because the Google Drive home page was never really finishing to load. After disabling the headless mode within the config.py file and looking at the web console, I could understand that it was because an HTTP request was being cyclically emitted towards the https://www.gstatic.com/images/icons/material/system/1x/broken_image_grey600_18dp.png image (with Selenium returning a fake 403 response every time); I could then observe the unfiltering PNG images in the drive_interceptor function would solve the issue and have the page load succeed almost immediately.

After applying these two changes, the check_and_gen.py script gets to work on my setup.

Regards,

… Chromedriver binary is used under the Chromium/Ubuntu Snap distribution in order to prevent Selenium from crashing under this setup, and avoid filtering images when loading the Google Drive home page so that the corresponding page load does not time out
@mxrch mxrch merged commit 54dfb5a into mxrch:master May 22, 2022
@mxrch
Copy link
Owner

mxrch commented May 22, 2022

Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants