-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (31 loc) · 1.15 KB
/
main.py
File metadata and controls
40 lines (31 loc) · 1.15 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
from utils.setup_driver import setup_driver
from scripts.equipes_homologadas import executar_equipes_homologadas
from scripts.todas_equipes import executar_todas_equipes
import os
import time
def main():
# Caminho onde o CSV será salvo
pasta_download = 'C:\\Users\\LKeuu\\OneDrive\\Documentos\\projetos\\Crawler-Sisab\\import_csv_test'
os.makedirs(pasta_download, exist_ok=True)
# Inicializar o driver
driver = setup_driver()
try:
# Executar o primeiro script
print("Gerando Relatório de Cadastros Vinculados (SISAB EQUIPES HOMOLOGADAS)")
executar_equipes_homologadas(driver, pasta_download)
finally:
# Fechar o driver após o primeiro script
driver.quit()
# Aguardar um pouco antes de reiniciar o driver
time.sleep(10)
# Inicializar o driver novamente
driver = setup_driver()
try:
# Executar o segundo script
print("Gerando Relatório de Cadastros Vinculados (SISAB TODAS EQUIPES)")
executar_todas_equipes(driver, pasta_download)
finally:
# Fechar o driver após o segundo script
driver.quit()
if __name__ == "__main__":
main()