-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsubmit.py
More file actions
41 lines (34 loc) · 1.24 KB
/
Copy pathsubmit.py
File metadata and controls
41 lines (34 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import pandas as pd
from selenium import webdriver
import time
def fill_form():
data = pd.read_csv('data.csv')
recycle = data.shape[0]
for i in range(recycle):
print(i)
driver = webdriver.Chrome(executable_path='TEMPAT_WEBDRIVER_YANG_KALIAN_SIMPAN')
driver.get('LINK_GOOGLE_FORM')
time.sleep(1)
name = data.iloc[i]['name']
inputName = driver.find_element("xpath",'MASUKAN_DATA_XPATH')
for j in name:
inputName.send_keys(j)
time.sleep(0.05)
email = data.iloc[i]['email']
inputEmail = driver.find_element("xpath",'MASUKAN_DATA_XPATH')
for j in email:
inputEmail.send_keys(j)
time.sleep(0.05)
address = data.iloc[i]['address']
inputAddress = driver.find_element("xpath",'MASUKAN_DATA_XPATH'))
for j in address:
inputAddress.send_keys(j)
time.sleep(0.05)
submit = driver.find_element("xpath",'//*[@id="mG61Hd"]/div[2]/div/div[3]/div[1]/div/div/span/span')
submit.click()
time.sleep(0.5)
backForm = driver.find_element("xpath",'/html/body/div[1]/div[2]/div[1]/div/div[4]/a')
backForm.click()
time.sleep(1)
fill_form()
time.sleep(1)