Fix inline google search

Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
Yasir Aris M 2024-04-04 14:07:24 +07:00 committed by GitHub
parent dbf5ff7a1f
commit 0db01eb099
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -265,7 +265,7 @@ async def inline_menu(self, inline_query: InlineQuery):
link = result.select_one(".yuRUbf a")["href"] link = result.select_one(".yuRUbf a")["href"]
title = result.select_one(".DKV0Md").text title = result.select_one(".DKV0Md").text
try: try:
snippet = result.select_one("#rso .lyLwlc").text snippet = result.find(class_="kb0PBd cvP2Ce A9Y9g").get_text()
except: except:
snippet = "-" snippet = "-"
message_text = f"<a href='{link}'>{html.escape(title)}</a>\n" message_text = f"<a href='{link}'>{html.escape(title)}</a>\n"