Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

TypeError: 'coroutine' object is not callable, why? #283

Open
zeguangzhang opened this issue Dec 17, 2019 · 1 comment
Open

TypeError: 'coroutine' object is not callable, why? #283

zeguangzhang opened this issue Dec 17, 2019 · 1 comment

Comments

@zeguangzhang
Copy link

code is same as readme,and python 3.5
import asyncio
from pyppeteer import launch

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

then run, output content eg blow :

Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1758, in
main()
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1752, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1147, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/zzg/PycharmProjects/knowgraph/spider/yaojianju/test_yjj.py", line 11, in
asyncio.get_event_loop().run_until_complete(main())
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/Users/zzg/PycharmProjects/knowgraph/spider/yaojianju/test_yjj.py", line 6, in main
page = await browser.newPage()
TypeError: 'coroutine' object is not callable

@Mattwmaster58
Copy link

Hi @zeguangzhang , it looks like this project has been abandoned. You may want to consider the active fork pyppeteer2. Feel free to create an issue there if your problem persists with the updated libary.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants