Update scrapwebsite.py

This commit is contained in:
yasirarism 2022-12-12 17:43:55 +07:00 committed by GitHub
parent 030133c9d6
commit 6f2f14d427
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -175,6 +175,8 @@ async def pahe_scrap(_, message):
pesan = await message.reply("Please wait, scraping data..")
r = await http.get(f"https://yasirapi.eu.org/pahe?q={judul}")
res = r.json()
if not res["result"]:
return await pesan.edit("Yahh, no result found.")
data = "".join(f"**{count}. {i['judul']}**\n{i['link']}\n\n" for count, i in enumerate(res["result"], start=1))
try:
await pesan.edit(