
In this tutorial, we will learn how to Get Google Page Ranking in Python using the google library. Using this method, you can easily get the ranking of any website in google search results for any keyword. Using this python program, you can save a lot of time if you want to manually try the same, you will need to click many times and will need to search for the website manually which is a headache task.
We will need google library, to install it, type the below command in your terminal:
pip install google
Everything is pretty simple, we need to import the library and need to give some parameters like query and website name. We have explained everything using comments, let’s start:-
Code to Get Google Page Ranking in Python:
# importing library from googlesearch import search # enter website name website = input('Enter website: ') # enter query query = input('Enter query: ') # initilazing index=0 index = 0 # search will return an object containing # all url from google search results # here, tid is top level domain, # stop means how many search results you want # stop=100 means we will get top 100 results from google for i in search(query, tld="com", num=10, stop=100, pause=2): # checking website in results if website in i: # printing index of website and url print(index+1, i) index += 1
Output1:
Enter website: copyassignment
Enter query: python projects for resume
Website rank is: 1
URL is: https://copyassignment.com/20-python-projects-for-resume/
Check the below screenshot as proof:

Output2:
Enter website: copyassignment
Enter query: python oop projects
Website rank is: 1
URL is: https://copyassignment.com/python-oop-projects-source-code-and-example/
Check the below screenshot as proof:

There are some other ways to check the ranking of a website in google search results using Python, we are giving links to the best articles.
- with requests and urllib libraries(you will need google API for this method), link-> How to Get Google Page Ranking in Python
- with requests and beautifulSoup libraries, link-> How to get Rank of the page in google search results using BeautifulSoup?
Also Read:
- Unveiling the Future of AI Detector
- CodeWithHarry Earns 20 Lakhs per month from YouTube?
- Cleaning Service Booking System in Python Tkinter
- Farmers Ecommerce App using Python Tkinter
- Guidelines for Project Collaboration Process
- The system of the binary conversion
- What is web development for beginners?
- Guide to Proxy Servers: How They Work and Why You Need Them?
- Python | Check Armstrong Number using for loop
- Python | Factorial of a number using for loop
- Link in bio
- Microsoft Giving Free Machine Learning Course: Enroll Now
- Accenture Giving Free Developer Certificate in 2023
- Python | Asking the user for input until they give a valid response
- Python | How to iterate through two lists in parallel?
- Amazon Summer Internship 2023
- Python | How to sort a dictionary by value?
- Amazon Giving Free Machine Learning Course with Certificate: Enroll Now
- Google Summer Internship 2023
- Python | How to split a list into equally-sized chunks?
- 5 Secret ChatGPT skills to make money
- Python | Remove items from a list while iterating
- Free Google Certification Courses
- 5 AI tools for coders better than ChatGPT
- Python | How to get dictionary keys as a list
- New secrets to Earn money with Python in 2023
- Flower classification using CNN
- How to represent Enum in Python?
- 5 methods | Flatten a list of lists | Convert nested list into a single list in Python
- What does if __name__ == __main__ do in Python?