You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting an SSO login to a website (I have access to this) via scrapy-playwright, and find that my playwright-script hangs when I use wait_for_function and this recursively produces the same network requests in the reactor and are all consoled. Eventually, all tasks are pending -- example output:
....
task: <Task pending name='Task-88505' coro=<_make_request_logger.<locals>._log_request() running at /Users//tealium_playwright/venv/lib/python3.10/site-packages/scrapy_playwright/handler.py:463> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at /Users//tealium_playwright/venv/lib/python3.10/site-packages/pyee/asyncio.py:65, ProtocolCallback.__init__.<locals>.cb() at /Users//tealium_playwright/venv/lib/python3.10/site-packages/playwright/_impl/_connection.py:168]>
2022-12-10 21:06:09 [asyncio] ERROR: Task was destroyed but it is pending!
task: <Task pending name='Task-88624' coro=<_make_request_logger.<locals>._log_request() running at /Users//tealium_playwright/venv/lib/python3.10/site-packages/scrapy_playwright/handler.py:463> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at /Users//tealium_playwright/venv/lib/python3.10/site-packages/pyee/asyncio.py:65, ProtocolCallback.__init__.<locals>.cb() at /Users//tealium_playwright/venv/lib/python3.10/site-packages/playwright/_impl/_connection.py:168]>
Email me for a working email to test. However, replacing wait_for_function with evaluate and using the above, I find that only the first query is implemented, and click is not activated. Because, otherwise, I would get red-text under the input highlighting the email is incorrect. Any idea why this might be happening?
P.S.
It works absolutely fine on the console of the web-browser.
--
I eventually got it working by including multiple wait_for_timeouts, which worked better than wait_for_function, however, I would be interested to know why the latter keeps the crawler in a loop inside the reactor with unfinished tasks.
But I get the following page indicating the CSRF is invalid and so the cookies were not set-up properly. What do you advise? I have attempted this with scrapy-splash it redirects to the original page (not supposed to), it's a matter of how to properly assign cookies so your advice will be very helpful!.
The text was updated successfully, but these errors were encountered:
I am attempting an SSO login to a website (I have access to this) via scrapy-playwright, and find that my playwright-script hangs when I use
wait_for_function
and this recursively produces the same network requests in the reactor and are all consoled. Eventually, all tasks are pending -- example output:I have attempted the following script:
Email me for a working email to test. However, replacing
wait_for_function
withevaluate
and using the above, I find that only the first query is implemented, andclick
is not activated. Because, otherwise, I would get red-text under the input highlighting the email is incorrect. Any idea why this might be happening?P.S.
It works absolutely fine on the console of the web-browser.
--
I eventually got it working by including multiple
wait_for_timeouts
, which worked better thanwait_for_function
, however, I would be interested to know why the latter keeps the crawler in a loop inside the reactor with unfinished tasks.But I get the following page indicating the CSRF is invalid and so the cookies were not set-up properly. What do you advise? I have attempted this with
scrapy-splash
it redirects to the original page (not supposed to), it's a matter of how to properly assign cookies so your advice will be very helpful!.The text was updated successfully, but these errors were encountered: