import requests from bs4 import BeautifulSoup import urllib.parse query = input("Enter your Google Dork: ") # تبدیل دورک به فرمت جستجوی گوگل query = urllib.parse.quote_plus(query) url = f"https://www.google.com/search?q={query}" headers = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0 Safari/537.36" } print("\n[+] Searching in Google...\n") res = requests.get(url, headers=headers) soup = BeautifulSoup(res.text, "html.parser") # پیدا کردن لینک‌ها links = [] for a in soup.select("a"): href = a.get("href") if href and "url?q=" in href and not "webcache" in href: link = href.split("url?q=")[1].split("&sa=")[0] if link.startswith("http"): links.append(link) if not links: print("[-] No results found (Google may have blocked you).") else: for link in links: print(link) with open("results.txt", "w") as f: f.write("\n".join(links)) print(f"\n[+] Saved {len(links)} results to results.txt")