Mac で Python 2.7.1 バインディングを使用して Selenium 2.25.0 を使用しています。これを実行すると、ソケット エラーが発生します。
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium import selenium
import unittest, time, re, base64, urllib, httplib, urllib2
#Create Selenium object
browser = selenium("localhost", 4444, "*firefox", "http://www.google.com/")
#Start browser
browser.start()
そして、最後のステップ ( browser.start
) で、次のエラーが発生します。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/selenium.py", line 189, in start
result = self.get_string("getNewBrowserSession", start_args)
File "/Library/Python/2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/selenium.py", line 223, in get_string
result = self.do_command(verb, args)
File "/Library/Python/2.7/site-packages/selenium-2.25.0-py2.7.egg/selenium/selenium.py", line 212, in do_command
conn.request("POST", "/selenium-server/driver/", body, headers)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 941, in request
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 975, in _send_request
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 937, in endheaders
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 797, in _send_output
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 759, in send
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 740, in connect
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection
socket.error: [Errno 61] Connection refused
さまざまなポートをいじってみましたが、これで問題は解決しません。私がここで見逃している明らかな何かがある場合はお詫び申し上げます。ご協力いただきありがとうございます!