import asyncio
from pyppeteer import launch, executablePath
from pyquery import PyQuery as pq
async def main():
browser = await launch(
{executablePath: 'C:\\Users\\Administrator\\AppData\\Local\\pyppeteer\\chrome-win\\chrome.exe'})
page = await browser.newPage()
await page.goto('http://quotes.toscrape.com/js/')
doc = pq(await page.content())
print('Quotes:', doc('.quote').length)
await browser.close()
asyncio.get_event_loop().run_until_complete(main())
[W:pyppeteer.chromium_downloader] start chromium download. Download may take a few minutes.
1
u823tg 2020-06-02 18:32:32 +08:00
Note: When you run pyppeteer first time, it downloads a recent version of Chromium (~100MB). If you don’t prefer this behavior, run pyppeteer-install command before running scripts which uses pyppeteer.
大兄弟不看文档吗? |
2
gwy15 2020-06-02 18:34:42 +08:00
|
4
dawnzhu OP 我添加了路径的啊,谢谢大佬,我在看看
|