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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
This pull request fixes two bugs:
check_and_gen.py
" script on Ubuntu 20.04 with Chromium 101 installed from the standard Ubuntu Snap package, the script was crashing at theFetching Drive homepage...
step with the following error message: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 tochromedriver
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-tThis 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 thedrive_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,