我不明白如何让机器人一次发送两个(或更多)解析结果(函数响应)。假设我想解析温度和降水。
def pars(html):
soup = BeautifulSoup(requests.get(html).text, 'lxml')
temperature = soup.find('span', class_="_h3 align-top me-1 d-inline-block")
weather = soup.find('div', class_="col-16 text-500")
#print(weather, temperature)
#data = {temperature, weather }
return temperature, weather
<...>
bot.send_message(message.chat.id, text=pars(url))
通过电报中的代码,我只收到一件事。当试图将数据返回到一个城市时,它顽固地只发送温度,而发送到另一个城市 - 天气。请告诉我,是否可以在一条消息中放置多个变量?