0

I'm unable to use Safari browser on macos with selenium webdriver-3.11.0 and python-3.6 I've followed steps below:

Downloaded safari extension from seleniumhq.org checked allow remote automation on safari browser.

Executed code:

from selenium import webdriver
driver = webdriver.Safari()

Got error:

issue observed
Traceback (most recent call last):
  File "/Users/phaneendra.gondi/IdeaProjects/python with webdriver/first_prog.py", line 23, in <module>
    driver = webdriver.Safari()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/safari/webdriver.py", line 49, in __init__
    self.service.start()
AttributeError: 'WebDriver' object has no attribute 'service'

Process finished with exit code 1
James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    This could be a possible solution: https://stackoverflow.com/questions/49158246/unable-to-start-selenium-safari-webdriver-via-python3 – Fine Apr 10 '18 at 16:43

1 Answers1

0

There is a bug in Safari webdriver which is fixed but not released yet. If you really want to make it work, you can "patch" Safari webdriver by adding line 25 and 49 https://github.com/SeleniumHQ/selenium/commit/2a0f63d19bd6e666ad432ee459762489d6b6033a

hserge
  • 905
  • 1
  • 9
  • 12