Hello,
If you are looking for Google Chrome, please see this link.
For some purpose I had to run different versions of Mozilla Firefox using selenium python. I used different versions of firefoxes from here.
After downloading proper version/os version, I had to simply install the browser using custom mode.
Then choose a custom place to install. Like C:\Program Files\FirefoxVersion54
Important: Do not launch the firefox.
Go to the installation directory and delete three update files from there namely:
1. updater.exe
2. updater.ini
3. update-settings.ini
Then launch the firefox and check the version.
Now from the python code do the following:
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium import webdriver
import random
# Assumed that you have installed 52 and 53 as well in the proper path.
version_to_use = random.choice(['54', '52', '53'])
path = r'C:\\Program Files\\FirefoxVersion%s\\firefox.exe' % version_to_use
firefox_binary = FirefoxBinary(path)
driver = webdriver.Firefox(firefox_binary=self.firefox_binary)
driver.get('http://nabinkhadka.com.np/')
If you are looking for Google Chrome, please see this link.
For some purpose I had to run different versions of Mozilla Firefox using selenium python. I used different versions of firefoxes from here.
After downloading proper version/os version, I had to simply install the browser using custom mode.
Then choose a custom place to install. Like C:\Program Files\FirefoxVersion54
Important: Do not launch the firefox.
Go to the installation directory and delete three update files from there namely:
1. updater.exe
2. updater.ini
3. update-settings.ini
Then launch the firefox and check the version.
Now from the python code do the following:
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium import webdriver
import random
# Assumed that you have installed 52 and 53 as well in the proper path.
version_to_use = random.choice(['54', '52', '53'])
path = r'C:\\Program Files\\FirefoxVersion%s\\firefox.exe' % version_to_use
firefox_binary = FirefoxBinary(path)
driver = webdriver.Firefox(firefox_binary=self.firefox_binary)
driver.get('http://nabinkhadka.com.np/')
Hope this helps everyone. :)
Good luck
Comments
Post a Comment