コンソールの下に 2 つのリモートが表示されますが、リモートで接続して何かを実行しようとすると、404 で失敗します。
from selenium import webdriver
browser = webdriver.Remote(
command_executor='http://ec2-184-72-129-183.compute-1.amazonaws.com:4444/wd/hub',
desired_capabilities={'browserName': 'firefox'})
browser.get('http://www.google.com')
browser.quit()
この例外をスローします
Traceback (most recent call last):
File "browser-shot.py", line 16, in <module>
desired_capabilities={'browserName': 'firefox'})
File "/usr/local/lib/python2.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 62, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 104, in start_session
'desiredCapabilities': desired_capabilities,
File "/usr/local/lib/python2.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 155, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.6/dist-packages/selenium/webdriver/remote/errorhandler.py", line 125, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: '<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>\n<title>Error 404 </title>\n</head>\n<body><h2>HTTP ERROR: 404</h2><pre>NOT_FOUND</pre>\n<p>RequestURI=/wd/hub/session</p><p><i><small><a href="http://jetty.mortbay.org/">Powered by Jetty://</a></small></i></p><br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n<br/> \n\n</body>\n</html>\n'