-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ERROR:asyncio:Task was destroyed but it is pending #3499
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
Comments
I ran SeleniumBase/examples/cdp_mode/raw_xhr_async.py without issue. ![]() I also ran SeleniumBase/examples/cdp_mode/raw_xhr_sb.py without issue. ![]() Not sure how you got those asyncio issues. Make sure you're following the steps of the examples correctly. |
yea, I know sample code have no error, but if I pass in different host and port in the driver line 61, I got the error |
There are examples for the correct way to set host and port (for taking control of an existing Chrome browser) here: |
I see the issue: |
Depending on what you're trying to do, you would use import asyncio
from seleniumbase.undetected.cdp_driver import cdp_util
async def main():
host = "127.0.0.1"
port = 9222
driver = await cdp_util.start_async(host=host, port=port)
page = await driver.get("https://seleniumbase.io/")
await asyncio.sleep(2)
print(await page.evaluate("document.title"))
element = await page.find("CDP Mode")
await element.click_async()
await asyncio.sleep(2)
print(await page.evaluate("document.title"))
if __name__ == "__main__":
asyncio.run(main()) (That example assumes you already have a browser open with that remote-debugging-port.) |
yes, there is a browser opened, |
SeleniumBase/seleniumbase/core/sb_cdp.py Line 950 in 36b8f78
SeleniumBase/seleniumbase/fixtures/base_case.py Line 1270 in 36b8f78
seleniumbase/undetected/cdp_driver/cdp_util.py is mainly from the |
I see, use |
seleniumbase/undetected/cdp_driver/connection.py:543
perhaps change the synchronous cancel() method on Listener into an async one?
The text was updated successfully, but these errors were encountered: