python webdriver和asynci

2024-04-26 14:56:20 发布

您现在位置:Python中文网/ 问答频道 /正文

是否可以先打开每个任务的浏览器,然后加载链接? 此代码引发错误

import asyncio
from selenium import webdriver

async def get_html(url):
    driver = await webdriver.Chrome()
    response = await driver.get(url)

TypeError:对象WebDriver不能用于“await”表达式


Tags: 代码fromimportasynciourlgetasync链接