summaryrefslogtreecommitdiff
path: root/backlinkchecker.py
blob: 45076b0725b14e1bd712d536bd201d66ad01dce9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import requests
from bs4 import BeautifulSoup

DOMAIN = "example.com"
query = f"link:{DOMAIN}"
url = f"https://www.google.com/search?q={query}"

# Proxy setup (Replace with a working proxy)
proxies = {
    "http": "http://your_proxy:port",
    "https": "https://your_proxy:port"
}

headers = {"User-Agent": "Mozilla/5.0"}

response = requests.get(url, headers=headers, proxies=proxies)
soup = BeautifulSoup(response.text, "html.parser")

for link in soup.find_all("a"):
    href = link.get("href")
    if "http" in href:
        print(href)