-
Notifications
You must be signed in to change notification settings - Fork 0
/
aa.py
49 lines (36 loc) · 1.28 KB
/
aa.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
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
import os
import ctypes
def chrome_driver_path():
return (str(os.getcwd()).replace("\\","\\\\")+"\\\\chromedriver.exe")
def setting_file():
urls=[]
f = open('setting.txt', mode='r', encoding='utf-8')
time_setting=f.readline()
screentshot_setting=f.readline()
with f as fp:
for line in fp:
urls.append(line[:len(line)-(line[::-1].find(','))-1])
wait_time = int(time_setting[time_setting.find('TIME=')+5:time_setting.find(';')])
screentshot = int(time_setting[time_setting.find('TIME=')+5:time_setting.find(';')])
return (urls,wait_time)
def main () :
try:
# setting chrome option
urls,wait_time=setting_file()
chrome_options = Options()
chrome_options.add_argument("--disable-infobars")
chrome_options.add_argument("--start-maximized")
chrome_options.add_argument("--start-fullscreen")
driver = webdriver.Chrome(executable_path =chrome_driver_path(),chrome_options=chrome_options)
while(True):
for detail_url in urls:
driver.get(detail_url)
#ctypes.windll.user32.MessageBoxW(0,"Warnning","EMergcy",16)
time.sleep(wait_time)
except Exception as error:
print ("Error : ",error)
driver.quit()
main()