pythonのphantomJSでエラー「AttributeError: module 'selenium.webdriver' has no attribute 'PhantomJS'.」
windows10のpythonでphantomJSを実行しようとしたら下記エラーが発生
「AttributeError: module 'selenium.webdriver' has no attribute 'PhantomJS'.」
パスが通っていないのかと思い以下のように設定したがそれでもエラー
pjs_path = './bin/phantomjs.exe'
cls.__phantomJsDriver = webdriver.PhantomJS(
executable_path=pjs_path,
desired_capabilities={
'phantomjs.page.settings.userAgent': userAgent,
},
service_log_path=log_name)
色々調査した結果
selenium6系ではphontomjs未対応の為ぽい。
(phontomJSは開発が終了しているから?)
下記で3.3にアップデートしたら使用できた。
pip install -U selenium==3.3.0