2016-06-17 8 views
0

私はちょうどセレンで作業を始めました。しかし、私はPythonでセレンを扱うことができません

Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 248, in get 
    self.execute(Command.GET, {'url': url}) 
    File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 234, in execute 
    response = self.command_executor.execute(driver_command, params) 
    File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/remote_connection.py", line 401, in execute 
    return self._request(command_info[0], url, body=data) 
    File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/remote_connection.py", line 431, in _request 
    self._conn.request(method, parsed_url.path, body, headers) 
    File "/usr/lib/python3.5/http/client.py", line 1106, in request 
    self._send_request(method, url, body, headers) 
    File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request 
    self.endheaders(body) 
    File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders 
    self._send_output(message_body) 
    File "/usr/lib/python3.5/http/client.py", line 934, in _send_output 
    self.send(msg) 
    File "/usr/lib/python3.5/http/client.py", line 877, in send 
    self.connect() 
    File "/usr/lib/python3.5/http/client.py", line 849, in connect 
    (self.host,self.port), self.timeout, self.source_address) 
    File "/usr/lib/python3.5/socket.py", line 711, in create_connection 
    raise err 
    File "/usr/lib/python3.5/socket.py", line 702, in create_connection 
    sock.connect(sa) 
ConnectionRefusedError: [Errno 111] Connection refused 

この問題に遭遇してきた私は、ウェブ上で検索してみてくださいでした。 私のセレンとFirefoxのバージョンは最新です。 これはちょうど始まりだったので、私はインターネットから簡単な3行を持っていて、それを実行しようとしていました。

>>> from selenium import webdriver 
>>> br = webdriver.Firefox() 
>>> br.implicitly_wait(15) 
>>> br.get('http://youtube.com') 
+0

あなたが最初のFirefoxのプロファイルを設定しようとした[Firefoxの更新後のセレンとすることはできません開いているブラウザ](HTTPの –

+0

が重複する可能性が? ://stackoverflow.com/questions/37761668/cant-open-browser-with-selenium-after-firefox-update) – Mobrockers

答えて

0

最新バージョンのfirefoxブラウザ& geckodriverがインストールされていることを確認してください。ドライバの最新バージョンを探す

  1. wget https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-arm7hf.tar.gz

  2. は、それが実行可能にtar -xvzf geckodriver*

  3. でファイルを抽出します。chmod +x geckodriver最新のヤモリは、以下の手順に従ってインストールするには

  4. PATHにドライバを追加しますので、他のツールはそれを見つけることができます。 export PATH=$PATH:/path-to-extracted-file/geckodriver

関連する問題