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

Does not work anymore, QR code does not load and then crashes #60

Open
alexferra opened this issue Jan 3, 2025 · 5 comments
Open

Does not work anymore, QR code does not load and then crashes #60

alexferra opened this issue Jan 3, 2025 · 5 comments

Comments

@alexferra
Copy link

03-Jan-25 16:26:01 - ERROR - __getQrCode
Traceback (most recent call last):
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 380, in __getQrCode
qr_result = await self.scrapeImg()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 684, in scrapeImg
click = await self.ThreadsafeBrowser.page_evaluate("""() => {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\browser.py", line 16, in wrapper
return await method(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\browser.py", line 162, in page_evaluate
return await super().page_evaluate(*args, page=page, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 538, in page_evaluate
return await self.create_task(page.evaluate(*args, kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 309, in create_task
return await self.loop.create_task(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright\async_api_generated.py", line 8495, in evaluate
await self._impl_obj.evaluate(
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_page.py", line 467, in evaluate
return await self._main_frame.evaluate(expression, arg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_frame.py", line 278, in evaluate
await self._channel.send(
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 61, in send
return await self._connection.wrap_api_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 528, in wrap_api_call
raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
playwright._impl._errors.Error: Page.evaluate: TypeError: Cannot read properties of null (reading 'closest')
at eval (eval at evaluate (:234:30), :3:47)
at UtilityScript.evaluate (:241:19)
at UtilityScript. (:1:44)
03-Jan-25 16:26:02 - ERROR - Exception in callback AsyncIOEventEmitter._emit_run..callback(<Task finishe... navigation')>) at C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\pyee\asyncio.py:69
handle: <Handle AsyncIOEventEmitter._emit_run..callback(<Task finishe... navigation')>) at C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\pyee\asyncio.py:69>
Traceback (most recent call last):
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\pyee\asyncio.py", line 77, in callback
self.emit("error", exc)
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\pyee\base.py", line 215, in emit
self._emit_handle_potential_error(event, args[0] if args else None)
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\pyee\base.py", line 173, in _emit_handle_potential_error
raise error
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 80, in on_load
await self._afterPageLoad()
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 104, in _afterPageLoad
if await self.inject_api():
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 774, in inject_api
await self.ThreadsafeBrowser.add_script_tag(
(await getWaJs(self.wa_js_version)), page=self.page)
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\browser.py", line 16, in wrapper
return await method(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\browser.py", line 146, in add_script_tag
return await super().add_script_tag(*args, page=page, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 526, in add_script_tag
return await self.create_task(page.add_script_tag(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 309, in create_task
return await self.loop.create_task(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright\async_api_generated.py", line 8675, in add_script_tag
await self._impl_obj.add_script_tag(
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_page.py", line 500, in add_script_tag
return await self._main_frame.add_script_tag(**locals_to_params(locals()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_frame.py", line 458, in add_script_tag
return from_channel(await self._channel.send("addScriptTag", params))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 61, in send
return await self._connection.wrap_api_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 528, in wrap_api_call
raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
playwright._impl._errors.Error: Page.add_script_tag: Execution context was destroyed, most likely because of a navigation
03-Jan-25 16:26:25 - ERROR - __getQrCode
Traceback (most recent call last):
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 380, in getQrCode
qr_result = await self.scrapeImg()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 684, in scrapeImg
click = await self.ThreadsafeBrowser.page_evaluate("""() => {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\browser.py", line 15, in wrapper
raise TargetClosedError()
playwright.impl.errors.TargetClosedError: Target page, context or browser has been closed
03-Jan-25 16:26:25 - ERROR - sleep
Traceback (most recent call last):
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\browser.py", line 55, in sleep
super().sleep(val, timeout
=timeout
)
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 544, in sleep
self.run_threadsafe(asyncio.sleep(val), timeout
=timeout
)
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 330, in run_threadsafe
return self._handle_future(future, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 576, in __handle_future
return future.result(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 454, in result
raise CancelledError()
concurrent.futures._base.CancelledError
Traceback (most recent call last):
File "C:\Users\Alefe\source\repos\Sales Tax A\instagrapi\examples\whatsappBOT.py", line 11, in
client = creator.start()
^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\initializer.py", line 133, in start
self.create_sync()
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\initializer.py", line 157, in create_sync
is_logged = self.client.waitForLogin()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 568, in waitForLogin
raise Exception('Failed to read the QRCode')
Exception: Failed to read the QRCode
03-Jan-25 16:26:25 - ERROR - Task exception was never retrieved
future: <Task finished name='Task-635' coro=<Channel.send() done, defined at C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py:60> exception=TargetClosedError('Channel.send: Target page, context or browser has been closed')>
Traceback (most recent call last):
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 61, in send
return await self._connection.wrap_api_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 528, in wrap_api_call
raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
playwright._impl._errors.TargetClosedError: Channel.send: Target page, context or browser has been closed

@3mora2
Copy link
Owner

3mora2 commented Jan 6, 2025

what's your version

@alexferra
Copy link
Author

@3mora2 latest version 4.8.1

@3mora2
Copy link
Owner

3mora2 commented Jan 7, 2025

version of config (whatsapp, wa)
and your start code

@alexferra
Copy link
Author

I updated selenium and playwrith and it worked. question does it support locked chats?

@3mora2
Copy link
Owner

3mora2 commented Jan 7, 2025

what you mean it support locked chats

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

2 participants