安装python3.6-pyppeteer

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

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

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

apt-get update

apt-get install python3.6

 

pip install pyppeteer

pyppeteer-install

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

import asyncio
from pyppeteer import launch

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()

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

转载于:https://my.oschina.net/u/2367514/blog/3028133

你可能感兴趣的:(安装python3.6-pyppeteer)