Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

554
Visualizações
Python Selenium - How to call embedded javascripts?

I would like to write a Python script to automate a process. Therefore I need interact with a webinterface. I installed Selenium and I'm able to call my webinterface and to login. Now I see a bunch of buttons but I can't just simply find them as an element as those are embedded in .js files. I can see them when I click in the browser on 'View Page source':

<script src="web/js/deviceWindow.js"></script>

When I click on deviceWindow.js I can see the Button where I want to click on:

this.setupButton = new Button();
this.setupButton.setText('Settings');
this.setupButton.text.addClass('configBtn');

How can I add this button click to my Python script?

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome('./chromedriver')

driver.get('http://10.143.140.220/login.html')

password = driver.find_element_by_name('password')
password.clear()
password.send_keys('password')
password.send_keys(Keys.RETURN)

I would appreciate any help :-) Thanks!

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

Your question is unclear, however.. is this helpful?

from selenium.webdriver.support import expected_conditions as EC
[...]

button = WebDriverWait(browser, 10).until(EC.element_to_be_clickable((By.XPATH, "//*[contains(text(), 'Settings')]")))
button.click()
about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda