Skip to content

04 web_scraping asyncio.create_task don't exist #5

@nissessenap

Description

@nissessenap

Hi

Don't understand how it works for you in the demo but when i run it crases straight away. I have tried multiple times and when i try to start 04-asyncio/web_scraping/async_scrape/program.py i get the following error.

python program.py
Traceback (most recent call last):
File "program.py", line 58, in
main()
File "program.py", line 32, in main
loop.run_until_complete(get_title_range())
File "/usr/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
return future.result()
File "program.py", line 49, in get_title_range
tasks.append((n, asyncio.create_task(get_html(n))))
AttributeError: module 'asyncio' has no attribute 'create_task'

Using pipenv:
aiodns==1.1.1
aiohttp==3.4.4
async-timeout==3.0.0
attrs==18.2.0
beautifulsoup4==4.6.3
bs4==0.0.1
cchardet==2.1.4
chardet==3.0.4
colorama==0.3.9
idna-ssl==1.1.0; python_version < '3.7'
idna==2.7
multidict==4.4.2
pycares==2.3.0
yarl==1.2.6

python --version
Python 3.6.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions