Description
from requests_html import AsyncHTMLSession
import functools
async def get_link(link):
r = await asession.get(link)
f = str(r) + link
return f
asession = AsyncHTMLSession()
links = [
'https://google.com',
'https://yahoo.com',
'https://python.org'
]
links = [
functools.partial(get_link, link) for link in links
]
print(links)
results = asession.run(*links)
print(results)
What I get is :
[functools.partial(<function get_link at 0x7fa59c438040>, 'https://google.com'), functools.partial(<function get_link at 0x7fa59c438040>, 'https://yahoo.com'), functools.partial(<function get_link at 0x7fa59c438040>, 'https://python.org')]
['<Response [200]>https://python.org', '<Response [200]>https://google.com', '<Response [200]>https://yahoo.com']
So why did the list of asession.run return in wrong order? is there a way to get the result in the same order they being send?