Skip to content

Commit

Permalink
#39 sync func calling async not problem
Browse files Browse the repository at this point in the history
  • Loading branch information
gingeleski committed Mar 17, 2019
1 parent 131f43f commit 3682926
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions conspiracy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import asyncio
from pyppeteer import launch

async def browser_stuff():
browser = await launch()
page = await browser.newPage()
await page.goto('http://example.com')
await page.screenshot({'path': 'example.png'})
await browser.close()

def main():
loop = asyncio.get_event_loop()
result = loop.run_until_complete(browser_stuff())

if __name__ == '__main__':
main()

0 comments on commit 3682926

Please sign in to comment.