Skip to main content

Google Maps Automation Project using Selenium Python.

Google Maps Automation Project using Selenium Python.


 Hello everyone, this is Hassaan in this article. We are going to learn about how to   automate the google maps website using selenium. Let's start Now, first we need to import the required libraries to perform this automation process our requirements   are selenium chrome web driver and time library these are the requirements to do this job.



After importing all the requirements you need to create a variable called   driver. In this variable you need to give your installation path of chrome web driver. Then you need to get the google maps website. So write driver dot get inside the brackets you need to mention your website name.


So this is the primary step of all selenium automation projects. Next we need to concentrate on searching the places in that google maps website create a function called this place. In this   function declare a variable called as place and inside this variable write driver dot find element by class name after this step. We need to open the chrome and search google maps.


Now you can see the   google maps website. In this website that is search bar, that is present in the web page. Go to the search bar and right click on that and again press the inspect option. Now you can see all the elements in the google maps. Website for giving the search   input through automation process. We need some web elements from the website.


That is the protocol of selenium library now look at the web elements in the website. Here you can see the   tactile search box input this is the required web element that we want so copy that element  and paste the element in our place variable next we need to send the input word to the website so   write place dot send keys inside the brackets you need to mention your destination place and the next step is we need to click the search button to process our input.


  Follow the same process that we did in the previous step go to the website and click the search button now inspect the button to fetch the web element and   copy the web element by xpath now in the function we need to create variable called as summit and in   this variable you need to paste the export value of your element that you copied from the website we successfully did the first part of automation and next we need to give another place to find out the kilometers in between our starting point and destination point additionally.


We are going to find out a few things that is how many hours to reach the   destination. What are the possible ways to reach that destination place. So this is the agenda of this article. Let's write a code for this conditions create a function called   as directions and in this function you have to declare a variable called as directions inside this variable you need to find a web element so go to the maps website and you   can see the directions button inspect the button and copy the xpath value we are going to send a click to the directions button.


So write directions.click   and this is enough for this function next create another function that is named as find go to your maps website and you can and now you can see that this website is asking for the starting point. It's a time to give the starting   point you need to give the starting point. But not manually we need to give the input through the automations. This is the main role of automations. Go to the search box and inspect the field and copy the web element export value now.


We have the web element value for the search box. Here you need   to give another place that is our starting point. Write find dot send keys and inside the brackets. You need to mention your starting point after completing these steps. We have two places the first place that we given that we are given is our destination and second place that we are given is our starting point next we need to process the search by clicking the search button.


So this   is the same process that we did in the previous part of automation. So follow my moves carefully after fetching the value of the search button. We need to send a click for that button to   process the given search inputs. So write send dot click this is the process of automation   and wait our process is not complete. We need to get how many kilometres between. These two places here we can apply the web scraping technique to fetch that results.


Create a function called as kilometres and in this function. You need to put your web element go to the website and you can see how many hours to reach the place by bus and train transport medium. We need these values to print our output screen so follow the same process that we   did in the previous step here.


I scrap the data from the google maps website  and print those data in my terminal at the end of this script you will notice how cool it is so we finished all the steps go to your terminal and enjoy   the automation process of selenium library you.


Google Maps Automation Project using Selenium Python.


Tips and tricks of WhatsApp.


Click here

Google Maps

Click here

I hope you will like it.

Google Maps Automation Project using Selenium Python


If you have any question or doubt please let me know.

 

If you have any question contact us on our Gmail and by posting the comment.

 

Our Gmail is mentioned below.

 

employeesgovernment58@gmail.com

Comments

Popular posts from this blog

How to use Snapchat for business very easy and simple.

How to use Snapchat for business very easy and simple. Today I'm going to talk to you about getting started with Snapchat for business. If you enjoy this, don't forget to comment it and follow to our site.  Let's get started. If you want to download the Snapchat app for free than simply click on the download button mentioned below then click on install the snapshot will be installed in your mobile. Click here-Download I hope you download the Snapchat. There are some pictures of Snapchat profiles and home page.  Snapchat highlights candid moments that connect users with the people behind your brand.  Since photos only last fora short amount of time, there's no pressure to make a lasting masterpiece that'll forever appear on your account. To start a Snapchat account for your business,  first download the Snapchat app for your iOS or Android device. Set up your Snapchat account just like you would any other app, enter your email and create a username and password. A wo

Google Keep Notes full use and tutorial.

Google Keep Notes full use and tutorial.     Google Keep notes  at its most basic is just for recording and organizing notes in Google keep notes. They can have a title, and then there's a body. If you want to go shopping and you just want to get some celery and some and some lettuce. You're feeling really health. If you go down and you close this note, there it is. It's done. You have your first note in Google Keep notes. Now let's go back into this note. I'm going to explain some things that are going on here. You just left click on it. It'll bring it back up into the middle and make everything grey. It's saying that we're focusing on this note. I'm going to let you format it, but you can't change the style of the text. It's not meant to be a word processor. It just wants quick notes. But, some of the things that you can do with it that I do all the time when I'm using it, is I can turn my list into to a checkbox. When you go and you ac

How to delete your YouTube channel.

Delete your YouTube channel.   Hello everyone, this is Hassaan, but yet adorable, YouTube expert, Derral Eves. Ok you thought it was going to be really easy to delete your YouTube channel. Go to YouTube studio. YT Studio But with all the recent changes to YouTube. YouTube's moved everything around. Not to speak of the Google+ Integration, this can be really confusing and really frustrating. Now here's the thing, there's actually different ways to delete your YouTube channel based on the factors that you set up your account. So if it's a stand alone account you do it one way. If it ties to a Google+ Profile you do it another way. If it's tied to a Google+ Page you do it another way. Rest assured I will take away all the pain and in this article. I'm going to show you three different ways to delete your YouTube channel forever. Let's take a look! Ok, the first one that I'm going to show you us actually a YouTube channel that doesn't connect to Google+.