I am not able to launch safari browser from Selenium web driver. I am using Python bindings. Could not find any reference that provided detailed steps for Python. I am aware there is a related question on stackoverflow, but it doesn't answer for python - python selenium webdriver safari driver
Followed the Documentation on http://code.google.com/p/selenium/wiki/SafariDriver , downloaded and installed safari developer certificate. This doc has code for Java and not for python bindings.
Below is my code(I am using desired capabilities) Not sure what am I missing here -
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium import webdriver
browser = webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.SAFARI)
browser.get('http://www.google.com')
browser.close()
From the looks of it, you're trying to open a webpage with a webbrowser. Why not use "webbrowser"? It's easy to get the webbrowser have safari as default:
import webbrowser
browser = webbrowser.get('safari')
browser.open("http://www.google.com/")
As I can't selenium set up, I'm not sure if this is what you want. Who knows, it could be an alternative?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With