fix: 🐛 temp solution for cookie

This commit is contained in:
Grey_D
2023-04-17 10:20:35 +08:00
parent 780187683a
commit 408a5b48c7
4 changed files with 15 additions and 3 deletions

View File

@@ -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":

View File

@@ -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?"