Skip to content

Commit

Permalink
Update misc_tools.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirarism authored Sep 10, 2024
1 parent 8a544f3 commit 0e6d6b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions misskaty/plugins/misc_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,12 @@ async def gsearch(self, message):
for result in soup.select(".tF2Cxc"):
link = result.select_one(".yuRUbf a")["href"]
title = result.select_one(".DKV0Md").text
self.log.info(result)
snippet = result.find(class_="VwiC3b yXK7lf lVm3ye r025kc hJNv6b").get_text() if result.find(class_="VwiC3b yXK7lf lVm3ye r025kc hJNv6b") else "-"
self.log.info(snippet)
if snippet := result.find(class_="VwiC3b yXK7lf lVm3ye r025kc hJNv6b"):
snippet = snippet.get_text()
elif snippet := result.find(class_="LEwnzc Sqrs4e"):
snippet = snippet.get_text()
else:
snippet = "-"
# appending data to an array
data.append(
{
Expand Down

0 comments on commit 0e6d6b7

Please sign in to comment.