mirror of
https://github.com/weyne85/PentestGPT.git
synced 2025-10-29 16:58:59 +00:00
fix: 🐛 temp solution for cookie
This commit is contained in:
@@ -234,14 +234,16 @@ class pentestGPT:
|
||||
# Google
|
||||
elif request_option == "google":
|
||||
# get the users input
|
||||
self.console.print("Please enter your search query. PentestGPT will summarize the info from google.", style="bold green")
|
||||
self.console.print(
|
||||
"Please enter your search query. PentestGPT will summarize the info from google.",
|
||||
style="bold green",
|
||||
)
|
||||
user_input = prompt_ask(
|
||||
"(End with <shift + right-arrow>) Your input: ", multiline=False
|
||||
)
|
||||
with self.console.status("[bold green] PentestGPT Thinking...") as status:
|
||||
# query the question
|
||||
result = self.google_search(user_input, 5) # 5 results by default
|
||||
|
||||
result = self.google_search(user_input, 5) # 5 results by default
|
||||
|
||||
# end
|
||||
elif request_option == "quit":
|
||||
|
||||
@@ -105,6 +105,7 @@ def parse_web(url) -> str:
|
||||
|
||||
return text
|
||||
|
||||
|
||||
def google_search(keyword, num_results=5) -> dict:
|
||||
"""
|
||||
Search on Google and return the results.
|
||||
@@ -124,6 +125,7 @@ def google_search(keyword, num_results=5) -> dict:
|
||||
search_result[url] = parse_web(url)
|
||||
result = {"keyword": keyword, "search_result": search_result}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# test to query google search on "what is penetration testing?"
|
||||
query = "what is penetration testing?"
|
||||
|
||||
Reference in New Issue
Block a user