requests_html
и в нем две асинхронные функции, одна из которых использует другую.async def parse_some_page(url):
response = await session.get(url)
response = response.html
task_link = url
data = response.find('#id', first=True).text
return data
async def parse_pages(url):
response = await session.get(url)
response = response.html
pre_result = [list(i.absolute_links)[0] for i in response.find('.selector')]
result = [await parse_some_page(i) for i in pre_result]
return result
message = '\n'.join([f"{tickers['market']['name']} - {tickers['trade_url']}" for tickers in data2['tickers']])
if len(message) > 4096:
for x in range(0, len(message), 4096):
msg.answer(message[x:x+4096])
else:
msg.answer(message.chat.id, message)