安裝python3.6-pyppeteer

apt-get install software-properties-common python-software-propertiespython

add-apt-repository ppa:jonathonf/python-3.6less

apt-get updatexss

apt-get install python3.6async

 

pip install pyppeteer

pyppeteer-installoop

apt-get install -y libx11-xcb1 libxrandr2 libasound2 libpangocairo-1.0-0 libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0 libnss3 libxss1url

import asyncio
from pyppeteer import launch.net

async def main():
    browser = await launch({'headless':True,'args':['--no-sandbox']})
    page = await browser.newPage()
    url='https://whoer.net/zh'
    await page.goto(url)
    await page.screenshot({'path': 'example.png'})
    await browser.close()ip

asyncio.get_event_loop().run_until_complete(main())
 ci

相關文章
相關標籤/搜索