私はpython firefox webdriverでfirefox webbrowserを呼び出すと、firefoxは空白のページ(ナビゲーションバーには何も表示されていません)で開いています。Firefox blank webbrowser with selenium
のpythonコンソルは私に、このエラーを与える:
トレースバック(最新の呼び出しの最後): ファイル "firefox_selenium2.py"、4行目、中 ドライバ= webdriver.Firefox() ファイル「は/ usr/"local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py"、行80、init self.binary、timeout) ファイル "/usr/local/lib/python3.5 /dist-packages/selenium/webdriver/firefox/extension_connection.py "、52行目、 self.binary.launch_browser(self.profile、timeout = timeout) ファイル "launch_browser内の" /usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/firefox_binary.py "、行68 self._wait_until_connectable(タイムアウト=タイムアウト) ファイル"/usr/local (self.profile.path) selenium.common.exceptions.WebDriverException:メッセージ:Can not 'プロファイルを読み込みます。プロファイルディレクトリ:/ tmp/tmpngm7g76x FirefoxBinaryコンストラクタでlog_fileを指定した場合は、詳細を確認してください。
私のコードはPythonのセレンread_the_docからexempleです:selenium.webdriver.common.keysインポートから セレンインポートから webdriverをキー
driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
すべてのヘルプは
PSをいただければ幸いです
:Firefoxのバージョン49 セレンのバージョン2.53.6 python 3.5
[セレン:FirefoxProfile例外がプロファイルを読み込むことができません]の可能な重複(http://stackoverflow.com/questions/6682009/selenium-firefoxprofile-exception-cant-load-the-profile) –