Selenium remote webdriver error (Connection refused)

Ro0t777
from selenium import webdriver
import sys
import os
cwd = os.getcwd()
driver= webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.CHROME,command_executor='http://127.0.0.1:4444')
driver.get('http://www.google.com')

error:

urllib.error.URLError: <urlopen error [Errno 61] Connection refused>

this program works a while ago, but now it does not. this is why I think it is a system error. (OSX 10.13.4)

unutbu

Make sure you've started the Selenium Standalone Server:

java -jar /path/to/selenium-server-standalone-<version>.jar 

You should see output which looks something like this:

Jun 06, 2018 6:47:59 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
18:47:59.720 INFO - Java: Oracle Corporation 24.171-b02
18:47:59.722 INFO - OS: Linux 3.13.0-149-generic amd64
18:47:59.731 INFO - v2.13.0, with Core v2.13.0. Built from revision 14793
18:47:59.889 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
18:47:59.891 INFO - Version Jetty/5.1.x
18:47:59.892 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
18:47:59.893 INFO - Started HttpContext[/selenium-server,/selenium-server]
18:47:59.893 INFO - Started HttpContext[/,/]
18:47:59.915 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@6c15f918
18:47:59.915 INFO - Started HttpContext[/wd,/wd]
18:47:59.919 INFO - Started SocketListener on 0.0.0.0:4444
18:47:59.919 INFO - Started org.openqa.jetty.jetty.Server@606145c5

Notice, in particular the line which reads:

RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub

Use this URL in command_executor:

from selenium import webdriver

driver = webdriver.Remote(
    desired_capabilities=webdriver.DesiredCapabilities.CHROME,
    command_executor='http://127.0.0.1:4444/wd/hub')
driver.get('http://www.google.com')

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Connection refused in Docker PostgreSQL

分類Dev

Selenium / TestBenchの失敗:net :: ERR_CONNECTION_REFUSED

分類Dev

ArangoDB web interface connection refused

分類Dev

Laravel Connection Refused Error

分類Dev

Angular 2 http does not catch connection refused error

分類Dev

Selenium Python selenium.common.exceptions.WebDriverException: Message: connection refused using geckodriver and firefox

分類Dev

Module not found: Error: Can't resolve 'http' in selenium-webdriver

分類Dev

kubectl apply command does not work, gives connection refused error

分類Dev

Selenium error message "selenium.webdriver has no attribute execute script"

分類Dev

Treafik UI - Kubernetes - Connection Refused

分類Dev

selenium.common.exceptions.WebDriverException: Message: connection refused while trying to open Firefox browser through GeckoDriver in Raspberry-pi3

分類Dev

php artisan migrate command error : Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] Connection refused

分類Dev

Connection refused when running testcafe

分類Dev

Angular 6 - ngx-mqtt 6.7.0 - Error in connection establishment: net::ERR_CONNECTION_REFUSED

分類Dev

tmux - connect failed: Connection refused

分類Dev

readiness probe fails with connection refused

分類Dev

Django:ERR_CONNECTION_REFUSED

分類Dev

Docker + Kong: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: connection refused

分類Dev

Connection refused error (111) when using Locust for Performance Testing against docker-compose app

分類Dev

Pinterest OAuth API - connect: connection refused - Error Code '12'

分類Dev

Fluentd + Elasticsearch = Connection refused

分類Dev

Nginx reverse proxy to backend gives an error ERR_CONNECTION_REFUSED

分類Dev

vnc viewer error: unable connect to socket: Connection refused (111)

分類Dev

Remote machine node unable to connect to hub on Selenium Webdriver using Ruby

分類Dev

Socket.error: [Errno 111] Connection refused when submitting an email using flask-mail

分類Dev

catch nodejs ERR_CONNECTION_REFUSED error

分類Dev

NFS connection refused

分類Dev

Python SimpleXMLRPCServer : Socket Error , Connection Refused

分類Dev

ssh connection refused

Related 関連記事

  1. 1

    Connection refused in Docker PostgreSQL

  2. 2

    Selenium / TestBenchの失敗:net :: ERR_CONNECTION_REFUSED

  3. 3

    ArangoDB web interface connection refused

  4. 4

    Laravel Connection Refused Error

  5. 5

    Angular 2 http does not catch connection refused error

  6. 6

    Selenium Python selenium.common.exceptions.WebDriverException: Message: connection refused using geckodriver and firefox

  7. 7

    Module not found: Error: Can't resolve 'http' in selenium-webdriver

  8. 8

    kubectl apply command does not work, gives connection refused error

  9. 9

    Selenium error message "selenium.webdriver has no attribute execute script"

  10. 10

    Treafik UI - Kubernetes - Connection Refused

  11. 11

    selenium.common.exceptions.WebDriverException: Message: connection refused while trying to open Firefox browser through GeckoDriver in Raspberry-pi3

  12. 12

    php artisan migrate command error : Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] Connection refused

  13. 13

    Connection refused when running testcafe

  14. 14

    Angular 6 - ngx-mqtt 6.7.0 - Error in connection establishment: net::ERR_CONNECTION_REFUSED

  15. 15

    tmux - connect failed: Connection refused

  16. 16

    readiness probe fails with connection refused

  17. 17

    Django:ERR_CONNECTION_REFUSED

  18. 18

    Docker + Kong: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: connection refused

  19. 19

    Connection refused error (111) when using Locust for Performance Testing against docker-compose app

  20. 20

    Pinterest OAuth API - connect: connection refused - Error Code '12'

  21. 21

    Fluentd + Elasticsearch = Connection refused

  22. 22

    Nginx reverse proxy to backend gives an error ERR_CONNECTION_REFUSED

  23. 23

    vnc viewer error: unable connect to socket: Connection refused (111)

  24. 24

    Remote machine node unable to connect to hub on Selenium Webdriver using Ruby

  25. 25

    Socket.error: [Errno 111] Connection refused when submitting an email using flask-mail

  26. 26

    catch nodejs ERR_CONNECTION_REFUSED error

  27. 27

    NFS connection refused

  28. 28

    Python SimpleXMLRPCServer : Socket Error , Connection Refused

  29. 29

    ssh connection refused

ホットタグ

アーカイブ