import asyncio
from ichrome import AsyncChromeDaemon
async def main():
async with AsyncChromeDaemon() as cd:
proxy = None
async with cd.incognito_tab(proxyServer=proxy) as tab:
# This tab will be created in the given BrowserContext
await tab.goto('http://httpbin.org/ip', timeout=10)
# print and watch your IP changed
print(await tab.html)
asyncio.run(main())
比如示例中这段代码,我如果想封装成类,在类中使用需要怎么改,谢谢