Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
Pruebas-RTO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 756b7488
authored
2024-07-27 20:22:20 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Mjora ssl error de cent
1 parent
793a84f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletions
iselenium.py
iselenium.py
View file @
756b748
...
...
@@ -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
:
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment