Enhancement: Improved ChromeDriver setup for Raspberry Pi
This PR introduces changes to the ChromeDriver setup logic in the login method to enhance compatibility and stability, particularly on Raspberry Pi devices.
Changes Made:
Added a new raspberry parameter to the login method.
When set to True, it triggers a Raspberry Pi-specific ChromeDriver configuration.
Defaults to False for other systems.
Modified the conditional logic for ChromeDriver setup:
If raspberry is False (non-Raspberry Pi environments):
Uses ChromeDriverManager().install() to automatically download and install the appropriate ChromeDriver version, ensuring compatibility and ease of use.
If raspberry is True (Raspberry Pi environments):
Assumes ChromeDriver is manually installed at /usr/bin/chromedriver.
Adds the following arguments to chrome_options for improved stability:
--no-sandbox: Disables the sandbox environment, often necessary on Raspberry Pi due to permission issues.
--disable-dev-shm-usage: Prevents Chrome from using shared memory, which can improve stability on resource-constrained devices.
--remote-debugging-port=9222: Enables remote debugging (optional, for troubleshooting).
Reasoning:
Previous implementations relied on ChromeDriverManager for all environments, including Raspberry Pi. However, due to the specific resource limitations and configuration differences on Raspberry Pi, this approach proved to be less stable.
Manually installing ChromeDriver and utilizing the specific chrome_options arguments mentioned above significantly enhances stability and reliability on Raspberry Pi devices. It also provides a more robust solution for environments where automatic ChromeDriver installation might not be feasible.
Benefits:
Improved stability and reliability of the login method on Raspberry Pi.
More robust ChromeDriver setup logic for various environments.
Clear distinction between Raspberry Pi and non-Raspberry Pi configurations.
Enhancement: Improved ChromeDriver setup for Raspberry Pi
This PR introduces changes to the ChromeDriver setup logic in the
login
method to enhance compatibility and stability, particularly on Raspberry Pi devices.Changes Made:
raspberry
parameter to thelogin
method.True
, it triggers a Raspberry Pi-specific ChromeDriver configuration.False
for other systems.raspberry
isFalse
(non-Raspberry Pi environments):ChromeDriverManager().install()
to automatically download and install the appropriate ChromeDriver version, ensuring compatibility and ease of use.raspberry
isTrue
(Raspberry Pi environments):/usr/bin/chromedriver
.chrome_options
for improved stability:--no-sandbox
: Disables the sandbox environment, often necessary on Raspberry Pi due to permission issues.--disable-dev-shm-usage
: Prevents Chrome from using shared memory, which can improve stability on resource-constrained devices.--remote-debugging-port=9222
: Enables remote debugging (optional, for troubleshooting).Reasoning:
Previous implementations relied on ChromeDriverManager for all environments, including Raspberry Pi. However, due to the specific resource limitations and configuration differences on Raspberry Pi, this approach proved to be less stable.
Manually installing ChromeDriver and utilizing the specific
chrome_options
arguments mentioned above significantly enhances stability and reliability on Raspberry Pi devices. It also provides a more robust solution for environments where automatic ChromeDriver installation might not be feasible.Benefits:
login
method on Raspberry Pi.