-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.py
69 lines (39 loc) · 1.25 KB
/
upload.py
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# importing selenium webdriver and time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time
# data inputs from excel
skuName = []
managePageUrl = []
fileLocation = []
# chrome driver
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
# user credentials
uName = ""
uPwd = ""
# automation start / get webpage
driver = webdriver.Chrome(chrome_options)
driver.maximize_window()
driver.get("")
# find user credential input elements on webpage
driver.find_element().click()
driver.find_element().send_keys(uName)
driver.find_element().send_keys(uPwd)
# time delay for recaptcha
time.sleep(20)
driver.send_keys(Keys.ENTER)
# execution loop
for i in range(len(skuName)):
# upload sequence
driver.get(managePageUrl[i])
driver.implicitly_wait(10)
driver.find_element().click()
driver.find_element().clear().send_keys(" " + skuName[i])
driver.find_element().send_keys(fileLocation[i])
time.sleep(15)
driver.find_element().submit()
print("upload complete")
# driver.close()