Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

[python] throws “ No connection could be made because the target machine actively refused it” error without using quit #15394

Closed
Sreyas-Sreelal opened this issue Jun 2, 2018 · 1 comment

Comments

@Sreyas-Sreelal
Copy link

Sreyas-Sreelal commented Jun 2, 2018

  1. Which version of PhantomJS are you using? Tip: run phantomjs --version.
    2.1.1
  2. What steps will reproduce the problem?
    Use following code to reproduce the problem
from selenium import webdriver
import time
import os

class Account:
    def __init__(self,client):
        self.client = client
        self.foo()

    def foo(self):
        self.client.get("https://google.com")

class User:
    def __init__(self,id):
        self.id = id

    def search(self,account):
        account.client.get("https://wwww.google.com")


client = webdriver.PhantomJS()
a = Account(client)
a.foo()

while True:
    someid = input("Input id : ")
    u = User(someid)
    u.search(a)
    while True:
        try:
            u.search(a)
            os.system("cls")
            print("Started.... press ctrl+c to stop")
            time.sleep(1)
        except KeyboardInterrupt:
            break
    if input("Search more? (y/n)").lower() == "n":
        break
  1. Which operating system are you using?
    Windows 10
  2. Did you use binary PhantomJS or did you compile it from source?
    Binary
  3. Please provide any additional information below.
    Run the minimal repro i provided.
    The error :

No connection could be made because the target machine actively refused it

is been thrown in the second iteration of first while (when i stops inside loop and allow continuation of first loop)

Python version is 3.5

Log : - ghostdriver.log

@ariya
Copy link
Owner

ariya commented Sep 13, 2018

Thank you for the report!
From the problem, it may require some troubleshooting on the webdriver side. Care to move the report to https://github.com/detro/ghostdriver?

@ariya ariya closed this as completed Sep 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants