att_1
This commit is contained in:
parent
fb3e222c3e
commit
baf28b43db
@ -3,7 +3,7 @@ from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
# from selenium.webdriver.chrome.service import Service # Usado apenas para Linux/Docker
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
import time
|
||||
import os
|
||||
@ -15,8 +15,8 @@ from datetime import datetime, timedelta
|
||||
import json
|
||||
|
||||
# Configuração da data
|
||||
USE_MANUAL_DATE = False # False = usar dia anterior automaticamente; True = usar MANUAL_DATE_STR
|
||||
MANUAL_DATE_STR = "15102025" # Formato DDMMAAAA, usado quando USE_MANUAL_DATE=True
|
||||
USE_MANUAL_DATE = True # False = usar dia anterior automaticamente; True = usar MANUAL_DATE_STR
|
||||
MANUAL_DATE_STR = "16112025" # Formato DDMMAAAA, usado quando USE_MANUAL_DATE=True
|
||||
|
||||
# Configuração de intervalo de datas (execução dia por dia)
|
||||
USE_DATE_RANGE = False # True = usar intervalo de datas; False = usar USE_MANUAL_DATE
|
||||
@ -174,17 +174,17 @@ def main():
|
||||
|
||||
# Usar o binário do Chromium instalado no sistema (para Kubernetes/Docker)
|
||||
# Comentar a linha abaixo se estiver rodando localmente no Windows
|
||||
chrome_options.binary_location = '/usr/bin/chromium'
|
||||
# chrome_options.binary_location = '/usr/bin/chromium'
|
||||
|
||||
# Inicializar o driver do Chrome
|
||||
print("Iniciando o navegador...")
|
||||
# Criar o service apontando para o chromedriver do sistema (Kubernetes/Docker)
|
||||
# Comentar a linha abaixo se estiver rodando localmente no Windows
|
||||
service = Service('/usr/bin/chromedriver')
|
||||
driver = webdriver.Chrome(service=service, options=chrome_options)
|
||||
# service = Service('/usr/bin/chromedriver')
|
||||
# driver = webdriver.Chrome(service=service, options=chrome_options)
|
||||
|
||||
# Para rodar localmente no Windows, use:
|
||||
# driver = webdriver.Chrome(options=chrome_options)
|
||||
driver = webdriver.Chrome(options=chrome_options)
|
||||
|
||||
try:
|
||||
# Acessar a URL
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user