While Selenium 4.x officially lists Python 3.7+ as a requirement, some users report it partially works on Python 3.6. However, there may be edge cases or unforeseen issues. Here’s how to proceed:
Option 1: Try Selenium 4.x (Unofficially)
Latest Selenium 4.x might work, but no guarantees. Test thoroughly.
sh
pip install selenium --upgrade
If you encounter errors (e.g., SyntaxError due to Python 3.6 incompatibility), downgrade to Selenium 3.141.0.
Option 2: Use Selenium 3.141.0 (Stable for Python 3.6)
Guaranteed compatibility:
sh
pip install selenium==3.141.0
Works with:
Older browsers (Firefox ESR, Chrome ≤81).
Legacy WebDrivers (GeckoDriver 0.26.0, ChromeDriver 79.0.3945.36).
Key Considerations
Browser Limitations:
Modern browsers (Chrome/Firefox) no longer support Windows 7. You’ll need:
Firefox ESR 52.x or Chrome 81 (last Win7-compatible versions).
Matching WebDriver versions (e.g., GeckoDriver 0.26.0 for Firefox ESR).
SSL/HTTPS Issues:
Older Python/WebDriver combos may fail on modern HTTPS sites. Fixes:
sh
pip install --upgrade certifi urllib3
Alternative: Portable Browsers:
Use portable versions of old browsers (e.g., Portable Chrome 79).
Final Recommendation
For reliability: Stick with Selenium 3.141.0 + legacy browsers.
For experimentation: Try Selenium 4.x but expect potential breaks.