Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

selenium

def run_local(self,os_name,os_version,browser,browser_version):
        "Return the local driver"
        local_driver = None
        if browser.lower() == "ff" or browser.lower() == 'firefox':
            local_driver = webdriver.Firefox()    
        elif  browser.lower() == "ie":
            local_driver = webdriver.Ie()
        elif browser.lower() == "chrome":
            local_driver = webdriver.Chrome()
        elif browser.lower() == "opera":
            opera_options = None
            try:
                opera_browser_location = opera_browser_conf.location
                options = webdriver.ChromeOptions()
                options.binary_location = opera_browser_location # path to opera executable
                local_driver = webdriver.Opera(options=options)
                    
            except Exception as e:
                print("
Exception when trying to get remote webdriver:%s"%sys.modules[__name__])
                print("Python says:%s"%str(e))
                if  'no Opera binary' in str(e):
                     print("SOLUTION: It looks like you are trying to use Opera Browser. Please update Opera Browser location under conf/opera_browser_conf.
")
        elif browser.lower() == "safari":
            local_driver = webdriver.Safari()

        return local_driver
Comment

PREVIOUS NEXT
Code Example
Python :: round down decimal python 
Python :: stdin and stdout in python 
Python :: semaphore in python 
Python :: how to access variable of one function in another function in python 
Python :: validate 
Python :: python re 
Python :: python docstring use 
Python :: Python list tutorial for beginners 
Python :: add new column to pandas dataframe 
Python :: import os python 
Python :: list all pip packages 
Python :: how to send a command to cmd using python 
Python :: filter dictionary python 
Python :: transformer in pytorch 
Python :: pandas split groupby 
Python :: joining two lists in python using for loop 
Python :: reference variable python 
Python :: initialize 2d array of zeros python 
Python :: set default dictionary in python 
Python :: dictionaries in python 
Python :: find last element in list python 
Python :: Python match.re and match.string 
Python :: how to append data in excel using python pandas 
Python :: python loop over list 
Python :: extract text from image python without tesseract 
Python :: comment multiple lines python 
Python :: python builtwith 
Python :: speed typing test python 
Python :: tkinter bind function with arguments 
Python :: python stack size 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =