This repository was archived by the owner on Aug 14, 2026. It is now read-only.
[BUG] <Return empty with v1.1.0-beta> #1260
Closed
vrlishimaihe
started this conversation in
General
Replies: 3 comments 1 reply
|
So, just to understand, you’ve never done this before with Whoogle? |
0 replies
|
Moved to a discussion as this is not an issue with Whoogle, but an issue with your code. I believe your code is looking for classes that don't exist. Unfortunately I am unable to assist you with this. |
1 reply
|
Thanks for your information. Let me check it again |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I installed [v1.1.0-beta], and I used a python script to search by keyword, but nothing returned. Can anybody help?
My script is below. Returned empty .
To Reproduce
Steps to reproduce the behavior:
`
import requests
from bs4 import BeautifulSoup
def whoogle_search(query, port=5001, host="127.0.0.1", max_results=5):
#:param query: search keyword
#:param port: Whoogle port
#:param host: Whoogle (127.0.0.1)
#:param max_results: the number of resutls
#:return: result list [{title, link, snippet}]
url = f"http://{host}:{port}/search"
params = {"q": query}
resp = requests.get(url, params=params, timeout=10)
if resp.status_code != 200:
raise Exception(f"failure: {resp.status_code}")
soup = BeautifulSoup(resp.text, "html.parser")
results = []
for idx, result in enumerate(soup.select("a.result__a"), start=1):
title = result.get_text()
link = result.get("href")
return results
if name == "main":
query = "python web scraping"
search_results = whoogle_search(query)
for i, res in enumerate(search_results, start=1):
print(f"{i}. {res['title']}")
print(f" links: {res['link']}")
print(f" summary: {res['snippet']}\n")
Version of Whoogle Search
All reactions