Kelupaan :

This commit is contained in:
yasirarism 2023-06-12 04:45:25 +00:00 committed by GitHub
parent 952b218e29
commit 4e746d4b83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -203,7 +203,7 @@ async def inline_menu(_, inline_query: InlineQuery):
search_results = await http.get(f"https://www.google.com/search?q={judul}&num=20", headers=headers) search_results = await http.get(f"https://www.google.com/search?q={judul}&num=20", headers=headers)
soup = BeautifulSoup(search_results.text, "lxml") soup = BeautifulSoup(search_results.text, "lxml")
data = [] data = []
for result in soup.find_all("div", class_="kvH3mc BToiNc UK95Uc") for result in soup.find_all("div", class_="kvH3mc BToiNc UK95Uc"):
link = result.find("div", class_ ="yuRUbf").find("a").get("href") link = result.find("div", class_ ="yuRUbf").find("a").get("href")
title = result.find("div", class_ ="yuRUbf").find("h3").get_text() title = result.find("div", class_ ="yuRUbf").find("h3").get_text()
try: try:

View file

@ -124,7 +124,7 @@ async def gsearch(client, message):
# collect data # collect data
data = [] data = []
for result in soup.find_all("div", class_="kvH3mc BToiNc UK95Uc") for result in soup.find_all("div", class_="kvH3mc BToiNc UK95Uc"):
link = result.find("div", class_ ="yuRUbf").find("a").get("href") link = result.find("div", class_ ="yuRUbf").find("a").get("href")
title = result.find("div", class_ ="yuRUbf").find("h3").get_text() title = result.find("div", class_ ="yuRUbf").find("h3").get_text()
try: try: