Skip to content

Instantly share code, notes, and snippets.

@wwj718
Last active August 22, 2018 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwj718/3c2027d3fbe6fbb67baa61ed33f1afb1 to your computer and use it in GitHub Desktop.
Save wwj718/3c2027d3fbe6fbb67baa61ed33f1afb1 to your computer and use it in GitHub Desktop.
用于scratch同步镜像数据
import asyncio
from pyppeteer import launch
async def main():
browser = await launch()
page = await browser.newPage()
await page.goto('http://www.baidu.com')
# await asyncio.sleep(10) # 等待加载图片
await page.screenshot({'path': '/tmp/example.png'})
await browser.close()
asyncio.get_event_loop().run_until_complete(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment