Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Launcher' object has no attribute 'proc' #59

Open
james-j-han opened this issue Sep 6, 2019 · 9 comments
Open

AttributeError: 'Launcher' object has no attribute 'proc' #59

james-j-han opened this issue Sep 6, 2019 · 9 comments

Comments

@james-j-han
Copy link

I've set headless to true as well.

@MacKey-255
Copy link

I've set headless to true as well.

Men update of my forked or see my pull request. Salu2s

@johnny-stevie
Copy link

Is anything happening about this?

@Datamined
Copy link

Men update of my forked or see my pull request. Salu2s

I've tried your fork, but the error is still the same.
OS: WIndows 7 64,
python: 3.7.5

Full traceback:

C:\Python37\lib\site-packages\nonocaptcha\base.py:20: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
settings = yaml.load(f)
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 65, in start
self.browser = await self.get_new_browser()
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 202, in get_new_browser
browser = await self.launcher.launch()
File "C:\Python37\lib\site-packages\nonocaptcha\launcher.py", line 67, in launch
env=env,
File "C:\Python37\lib\asyncio\subprocess.py", line 217, in create_subprocess_exec
stderr=stderr, **kwds)
File "C:\Python37\lib\asyncio\base_events.py", line 1533, in subprocess_exec
bufsize, **kwargs)
File "C:\Python37\lib\asyncio\base_events.py", line 463, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 80, in start
raise e
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 65, in start
self.browser = await self.get_new_browser()
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 202, in get_new_browser
browser = await self.launcher.launch()
File "C:\Python37\lib\site-packages\nonocaptcha\launcher.py", line 67, in launch
env=env,
File "C:\Python37\lib\asyncio\subprocess.py", line 217, in create_subprocess_exec
stderr=stderr, **kwds)
File "C:\Python37\lib\asyncio\base_events.py", line 1533, in subprocess_exec
bufsize, **kwargs)
File "C:\Python37\lib\asyncio\base_events.py", line 463, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "demo.py", line 15, in
solution = asyncio.get_event_loop().run_until_complete(client.start())
File "C:\Python37\lib\asyncio\base_events.py", line 584, in run_until_complete
return future.result()
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 93, in start
await self.cleanup()
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 148, in cleanup
await self.launcher.killChrome()
File "C:\Python37\lib\site-packages\nonocaptcha\launcher.py", line 114, in killChrome
await self.waitForChromeToClose()
File "C:\Python37\lib\site-packages\nonocaptcha\launcher.py", line 96, in waitForChromeToClose
if self.proc.returncode is None and not self.chromeClosed:
AttributeError: 'Launcher' object has no attribute 'proc'

@MacKey-255
Copy link

Men update of my forked or see my pull request. Salu2s

I've tried your fork, but the error is still the same.
OS: WIndows 7 64,
python: 3.7.5

Full traceback:

C:\Python37\lib\site-packages\nonocaptcha\base.py:20: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
settings = yaml.load(f)
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 65, in start
self.browser = await self.get_new_browser()
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 202, in get_new_browser
browser = await self.launcher.launch()
File "C:\Python37\lib\site-packages\nonocaptcha\launcher.py", line 67, in launch
env=env,
File "C:\Python37\lib\asyncio\subprocess.py", line 217, in create_subprocess_exec
stderr=stderr, **kwds)
File "C:\Python37\lib\asyncio\base_events.py", line 1533, in subprocess_exec
bufsize, **kwargs)
File "C:\Python37\lib\asyncio\base_events.py", line 463, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 80, in start
raise e
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 65, in start
self.browser = await self.get_new_browser()
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 202, in get_new_browser
browser = await self.launcher.launch()
File "C:\Python37\lib\site-packages\nonocaptcha\launcher.py", line 67, in launch
env=env,
File "C:\Python37\lib\asyncio\subprocess.py", line 217, in create_subprocess_exec
stderr=stderr, **kwds)
File "C:\Python37\lib\asyncio\base_events.py", line 1533, in subprocess_exec
bufsize, **kwargs)
File "C:\Python37\lib\asyncio\base_events.py", line 463, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "demo.py", line 15, in
solution = asyncio.get_event_loop().run_until_complete(client.start())
File "C:\Python37\lib\asyncio\base_events.py", line 584, in run_until_complete
return future.result()
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 93, in start
await self.cleanup()
File "C:\Python37\lib\site-packages\nonocaptcha\solver.py", line 148, in cleanup
await self.launcher.killChrome()
File "C:\Python37\lib\site-packages\nonocaptcha\launcher.py", line 114, in killChrome
await self.waitForChromeToClose()
File "C:\Python37\lib\site-packages\nonocaptcha\launcher.py", line 96, in waitForChromeToClose
if self.proc.returncode is None and not self.chromeClosed:
AttributeError: 'Launcher' object has no attribute 'proc'

Look at this video: https://www.youtube.com/watch?v=zgwetyKmg5g
Linux with Python 3.7.2
I need to test the project in Windows. Remember that the project needs to use the chrome browser. So it needs to be installed on your system. SAlu2s

@Francesco149
Copy link

it really isn't that hard to fix if you take a quick look at the code. also on windows you need to use ProactorEventLoop otherwise subprocess will throw NotImplementedError

diff --git a/examples/basic.py b/examples/basic.py
index 1d4609a..354a46d 100644
--- a/examples/basic.py
+++ b/examples/basic.py
@@ -10,7 +10,7 @@ else:
     sys.exit(0)


-loop = asyncio.get_event_loop()
+loop = asyncio.ProactorEventLoop()
 options = {
     "headless": False,
     "ignoreHTTPSErrors": True,
diff --git a/nonocaptcha/launcher.py b/nonocaptcha/launcher.py
index 2c3030c..844f404 100644
--- a/nonocaptcha/launcher.py
+++ b/nonocaptcha/launcher.py
@@ -29,7 +29,7 @@ class Launcher(launcher.Launcher):
         self.port = get_free_port()
         self.url = f'http://127.0.0.1:{self.port}'
         self.chrome_args = [f'--remote-debugging-port={self.port}']
-        self._loop = self.options.get('loop', asyncio.get_event_loop())
+        self._loop = self.options.get('loop', asyncio.ProactorEventLoop())

         logLevel = self.options.get('logLevel')
         if logLevel:
@@ -94,6 +94,8 @@ class Launcher(launcher.Launcher):
         return data['webSocketDebuggerUrl']

     async def waitForChromeToClose(self):
+        if "proc" not in self.__dict__:
+            return
         if self.proc.returncode is None and not self.chromeClosed:
             self.chromeClosed = True
             try:

@Francesco149
Copy link

full patch to make it work on windows: https://gist.github.com/314236b2ce5e7f5a96e846fe086e2dd6

@Francesco149
Copy link

also, to evade the new detections you can adapt these bypass methods and it'll work: https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth/evasions

@Francesco149
Copy link

working fork here, enjoy https://github.com/Francesco149/nonoCAPTCHA

@MacKey-255
Copy link

Captcha image recognition working fork here https://github.com/MacKey-255/GoodByeCatpcha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants