Note: Check below for a video example.
- Selenium
- Python
- Google Chrome
- ChromeDriver
- Microsoft Excel
The Task here is to fill multiple responses from a excel file with the same Google form using selenium in python. Link to the Google forms and excel file used in this example are given below:
- InformationCalls Form – Click Here
- Excel File – Click Here
- Python File– Click Here
- Agent Name
- Daniel
- David
- Source (Source of the call)
- Incoming Call
- Outgoing Call
- Phone Number
- Email Adress
- Product
- Home repairs
- Personal care
- Call Result
- Silent call
- Call dropped
- Unanswered call
- Transferred to sales
The exel file should be modified as needed. Always according to the changes in the code.
Note: This excel is ready for two types of forms. But this code only use the information form. Also you will need to adjust the route where you have the excel file.
In the image we can see what rows we use in this form
Using the Xpath of the google form we want to achieve our required functionality given steps needs to followed in an order:
- Import selenium and time module
- Excel File Path and Read Excel File
- Add chrome driver path
- Create dicctionaries
- Creation of Variables
- Open chrome and load google form
- Iterate through each data and fill detail
- Log File Creation
- Close the window
A log file will be created in the same folder where you execute the code to check if everything was ok or to check where the code failed ingesting data.
If you try this code with the same excel file, you can check the ingested data in this link
15.09.2022_11.28.05_REC.mp4
Do not hesitate to contact me for any further explanation about the code.
MIT
Free Software, Hell Yeah!
