MOHAN KRISHNA

0 %
Mohan Krishna
Multimedia Professional
Ai & ML Researcher & Enthusiast
  • Residence:
    India
  • City:
    Vijayawada
  • Age:
    46
AI/ML Enthusiast. New Media Trainer, VFX Artist, Non Linear Video Editor, Graphic Designer, Sound Editor and iOS App Designer.
Telugu
English
Hindi
Tamil
Proficiency:
Graphic Design
Web Design
Video & VFX
Machine Learning
Artificial Intelligence
Digital Marketing
Areas of Interest:
Take a look at some of the things I love working on.
  • Non Linear Video Editing
  • Graphic Design
  • Web Design
  • Audio Editing
  • Content Management Systems
  • Python
  • Deep Learning
  • OpenCV
  • Image Classification

Google Forms Auto Filling

September 10, 2022
# pillalamarri.in - python projects
import csv
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

inputName = '/html/body/div/div[2]/form/div[2]/div/div[2]/div[1]/div/div/div[2]/div/div[1]/div/div[1]/input'
inputEmailID = '/html/body/div/div[2]/form/div[2]/div/div[2]/div[2]/div/div/div[2]/div/div[1]/div/div[1]/input'
inputPhone = '/html/body/div/div[2]/form/div[2]/div/div[2]/div[3]/div/div/div[2]/div/div[1]/div/div[1]/input'

# Submit Button Xpath
Submit = '/html/body/div/div[2]/form/div[2]/div/div[3]/div[1]/div/div'


def sleep():
    time.sleep(3)


browswer = webdriver.Firefox(
    executable_path='C:\geckodriver-v0.28.0-win64\geckodriver.exe')
browswer.get(
    'https://docs.google.com/forms/d/e/1FAIpQLScBejWF809oacjZlvkciXREi50fyHcq75l988KDJo3ycG7xkg/viewform'
)
name = []
email = []
phone = []
with open("input.csv", "r") as f_input:
    csv_input = csv.DictReader(f_input)
    for row in csv_input:
        name.append(row['name'])
        email.append(row['email'])
        phone.append(row['phone_number'])

    # print(name,email,phone)
i = 0

while i < len(name):
    browswer.find_element_by_xpath(inputName).send_keys(name[i])
    browswer.find_element_by_xpath(inputEmailID).send_keys(email[i])
    browswer.find_element_by_xpath(inputPhone).send_keys(phone[i])
    sleep()
    browswer.find_element_by_xpath(Submit).click()
    i += 1
    sleep()
    browswer.back()
    sleep()

# print(name,email,phone)
browswer.quit()
# pillalamarri.in - python projects
Posted in PythonTags: