Commit 756b7488 by Tu Nombre

Mjora ssl error de cent

1 parent 793a84f6
......@@ -6,6 +6,11 @@ from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
import time
########################################################################
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
#from webdriver_manager.chrome import ChromeDriverManager
class SeleniumInterface:
Chrome = "Chrome"
......@@ -15,9 +20,12 @@ class SeleniumInterface:
PageChangeWait = 0.5
def __init__(self, driverType):
self.driver = self._getDriver(driverType)
self.chrome_options = Options()
self.chrome_options.add_argument("--ignore-certificate-errors")
self.driver = webdriver.Chrome(options=self.chrome_options)
def _getDriver(self, d):
#########QUEDA AL PEDO
if d == SeleniumInterface.Chrome:
return webdriver.Chrome()
raise NoSuchDriver(self.driver)
......@@ -54,6 +62,18 @@ class SeleniumInterface:
return array[0]
return array
def traerTextDiv(self,Id,No="?"):
try:
div = self.driver.find_element(By.ID, Id)
text = div.text
if text:
return text
else:
return No
except Exception as E:
print(f"Error en traerTextDiv {id}, {str(E)}")
return No
def write(self, element, keys, clear = True):
if clear:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!