Selenium Helper
Este pacote fornece um conjunto de utilitários para facilitar a interação com o Selenium WebDriver, incluindo funcionalidades para esperar por elementos, enviar texto, clicar em elementos, selecionar opções e mover o cursor sobre elementos.
Instalação
Você pode instalar o pacote diretamente do PyPI usando pip:
pip install trsolucoes
Uso
Aqui estão alguns exemplos de como usar as funções fornecidas pelo pacote.
Funções Principais
Importar pacotes
from selenium_helper import SeleniumHelper
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
sh = SeleniumHelper(driver)
find_element
Aguarda a presença de um elemento na página e retorna o próprio elemento ou um booleano indicando se o elemento foi encontrado.
locator = (By.ID, 'example-id')
element_found = sh.find_element(locator, return_element=True)
write_element
Aguarda a presença de um elemento e envia um texto para ele, com opções para limpar o campo e clicar no elemento antes de enviar o texto.
locator = (By.NAME, 'example-name')
sh.write_element(locator, 'example text', clear_form=True)
click_element
Aguarda a presença de um elemento e clica nele.
locator = (By.XPATH, '//button[@class="example-class"]')
sh.click_element(locator)
select_element
Aguarda a presença de um elemento select e seleciona uma opção pelo texto visível.
locator = (By.TAG_NAME, 'select')
tag_filter = [('ng-reflect-name', 'labelOption'), ('ngcontent-c2', 'xp789e687')]
sh.select_element(locator, 'Option Text', tag_filter=tag_filter)
click_in_text_element
Aguarda um breve período e clica em um elemento cujo texto corresponde ao texto fornecido.
locator = (By.TAG_NAME, 'button')
sh.click_in_text_element(locator, 'Button Text')
hover_element
Aguarda a presença de um elemento e passa o cursor do mouse sobre ele.
locator = (By.CLASS_NAME, 'hover-target')
sh.hover_element(locator)
Metadata
Release files for trsolucoes 9.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| trsolucoes-9.0.2.tar.gz | 6.6 kB | Without provenance | Details |
Release files / trsolucoes-9.0.2.tar.gz
| Download URL | trsolucoes-9.0.2.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e13c9cb7a7e8aa26c48e4fbf4d2cbba46ab2ce00651ae7f6730b8fbb1afff0c
|
|
BLAKE2b-256 checksum How to use checksums |
1fb9b97ed0241ffa50300d7f8460e07f905c0ced5bf173191065ab5aa53272e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for trsolucoes 9.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.