-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
code:
import uvloop
loop = uvloop.new_event_loop()
# loop = asyncio.get_event_loop()
chrome_executable_path = '/usr/lib64/chromium-browser/chromium-browser'
args = [
"--disable-gpu",
"--disable-web-security",
"--disable-xss-auditor",
"--no-sandbox",
"--disable-setuid-sandbox",
"--allow-running-insecure-content",
"--disable-webgl",
"--disable-popup-blocking",
'--disable-dev-shm-usage',
]
async def run(browser,url):
page = await browser.newPage(ignoreHTTPSErrors=True)
resp = await page.goto(url)
print(resp.status)
async def main2():
async with async_playwright() as p:
browser_type = p.chromium
browser = await browser_type.launch(executablePath=chrome_executable_path,args=args)
task = [run(browser, f'http://www.baidu.com/s?wd={x}') for x in range(10)]
await asyncio.gather(*task)
await browser.close()
if __name__ == '__main__':
loop.run_until_complete(main2())
out error:
python3: src/unix/core.c:932: uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.