一,安装第三方库:
$ pip install pyppeteer
$ pip install beautifulsoup4
二,代码
import asyncio
from pyppeteer import launchasync def check():browser = await launch(executablePath='/usr/bin/google-chrome-stable')page = await browser.newPage()await page.goto('https://example.com')print(await page.title())await browser.close()asyncio.run(check()) # 应输出"Example Domain"