- Aug 4, 2015
- 3,677
- 521
Hello Friends,
Today am Going to show you "How to make own bulk google index checker using Colab with Python"
Step 1: Sign in the Google Account and go to Google Colab
Step 2: Install the beautifulsoap and Google by using following code
Step 3: Click the folder icon in the leftsiderbar and right click to choose "Newfile" and rename as domains.txt
Step 4: Double click the domaint.txt, the editor is opened on right side and enter the urls or domains in the editor
Step 5: Paste the below code and click play to check the index status, suppose if you get any errors, please change the TLD in the code or else login the colab with some other mail id
For further queries about the working procedure please discuss here, thank you
Today am Going to show you "How to make own bulk google index checker using Colab with Python"
Step 1: Sign in the Google Account and go to Google Colab
Step 2: Install the beautifulsoap and Google by using following code
Code:
pip install beautifulsoup4
Code:
pip install google
Step 3: Click the folder icon in the leftsiderbar and right click to choose "Newfile" and rename as domains.txt
Step 4: Double click the domaint.txt, the editor is opened on right side and enter the urls or domains in the editor
Step 5: Paste the below code and click play to check the index status, suppose if you get any errors, please change the TLD in the code or else login the colab with some other mail id
Code:
try:
from googlesearch import search
except ImportError:
print("No module named 'google' found")
# Read domains from the uploaded "domains.txt" file
domains_to_check = []
with open("domains.txt", "r") as file:
domains_to_check = [line.strip() for line in file.readlines()]
# Initialize serial number
serial_number = 1
for domain in domains_to_check:
query = f"site:{domain}" # Create a query using the "site:" operator
found = False # Initialize a flag to check if the domain is indexed
# Perform the Google search with num=1
for _ in search(query, tld="co.in", num=1, stop=1, pause=2):
found = True
break # If a result is found, set found=True and exit the loop
# Display the result
if found:
print(f"{domain} - Indexed")
else:
print(f"{domain} - Not Indexed")
serial_number += 1 # Increment serial number for the next domain
For further queries about the working procedure please discuss here, thank you