-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsharepoint-automation.py
More file actions
128 lines (84 loc) · 2.53 KB
/
sharepoint-automation.py
File metadata and controls
128 lines (84 loc) · 2.53 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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env python
# coding: utf-8
# In[1]:
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time
# In[2]:
browser = webdriver.Firefox(executable_path=r'C:\Users\AJ\Documents\Pyhton-whatsapp-auto\geckodriver-v0.26.0-win64\geckodriver.exe')
# In[29]:
from openpyxl import Workbook, load_workbook
# In[30]:
wb = load_workbook('Live_Processes.xlsx')
print(wb.sheetnames)
work = wb['Model 1 & 2']
# In[33]:
c = work['AE209']
print(c.value)
start = 209
end = 416
# In[36]:
while start <= end:
cellName = 'AE'+ str(start)
c = work[cellName]
url = c.value
comment = ''
try:
browser.get(url)
wait = WebDriverWait(browser, 500);#5 sec Wait to scan the QR manually
spans = browser.find_elements_by_class_name("signalFieldValue_c079fcf3")
#print(len(spans))
sdd = 0
pdd = 0
uat = 0
gfcf = 0
kfas = 0
kfaCell = 'AM' + str(start)
e = work[kfaCell]
if e.value.lower == 'yes':
kfas = 1
for ele in spans:
fileName = ele.get_attribute('innerText')
n = len(fileName) - 31
finalName = fileName[0:n].lower()
if finalName.find('pdd'):
ext = finalName[finalName.find('.'):n]
if ext == '.docx' or ext == '.doc':
pdd = 1
if finalName.find('sdd'):
sdd = 1
if finalName.find('uat'):
if finalName.find('Sign_Off'):
uat = 1
if kfas == 1:
if finalName.find('gfcf'):
gfcf = 1
if pdd == 0:
comment = comment+"PDD Not Found, "
if sdd == 0:
comment = comment+"SDD Not Found, "
if uat == 0:
comment = comment+"UAT Sign Off Not Found, "
if kfas == 1 and gfcf == 0:
comment = comment+"GFCF Approval Mail Not Found, "
except:
comment = "Bad Url"
writeCell = 'BG' + str(start)
c4 = work[writeCell]
c4.value = comment
wb.save("Live_Processes.xlsx")
start += 1
# In[27]:
name = '''Business UAT Sign Off_e-Invoice Tesco.msg
Press C to open file hover card'''
print(len(name))
n = len(name) - 31
name = name[0:n].lower()
print(name)
print(name.find('Sign Off'))
print(name[name.find('.'):n])
# In[32]:
# In[ ]: