elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  Click en boton selenium y python
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Click en boton selenium y python  (Leído 4,214 veces)
dian1919

Desconectado Desconectado

Mensajes: 18


Ver Perfil
Click en boton selenium y python
« en: 7 Marzo 2023, 04:51 am »

Saludos estoy tratando de hacer un click en un boton con selenium y pyton el boton en la pagina su sección de codigo en la pagina es

Código
  1. <a class="start-button" href="javascript:" id="convert1">
  2.                                    Start
  3.                                    <i class="fa fa-angle-right fa-5"></i>
  4.                                </a>

para dar click en python



Código
  1. # getting the button by class name
  2. button = driver.find_element_by_class_name("Start")
  3.  
  4. # clicking on the button
  5. button.click()
  6.  




me sale este error
Traceback (most recent call last):
  File "C:\Users\WIND\Desktop\dat\prueba.py", line 10, in <module>
    button = driver.find_element_by_class_name("Start")
AttributeError: 'WebDriver' object has no attribute 'find_element_by_class_name'


En línea

reymosquito

Desconectado Desconectado

Mensajes: 81


Ver Perfil
Re: Click en boton selenium y python
« Respuesta #1 en: 7 Marzo 2023, 11:39 am »

¿y cómo está declarado driver?
otra cosa el nombre de la clase es start-button y no Start


En línea

Danielㅤ


Desconectado Desconectado

Mensajes: 1.675


🔵🔵🔵🔵🔵🔵🔵


Ver Perfil
Re: Click en boton selenium y python
« Respuesta #2 en: 7 Marzo 2023, 16:58 pm »

Hola, como estas cargando la librería de Selenium?


Saludos
En línea

dian1919

Desconectado Desconectado

Mensajes: 18


Ver Perfil
Re: Click en boton selenium y python
« Respuesta #3 en: 7 Marzo 2023, 18:28 pm »

Código
  1. from logging import error
  2. from selenium import webdriver
  3. from selenium.webdriver.support.ui import WebDriverWait
  4. import time
  5.  
  6.  
  7.  
  8.  
  9. # initialize the Chrome driver
  10. driver = webdriver.Chrome(r"chromedriver")
  11. # head to github login page
  12. driver.get("https://************** pagina personal")
  13. time.sleep(5)  # pauses execution for 5 seconds
  14.  
  15. # getting the button by class name
  16. button = driver.find_element_by_class_name("Start")
  17.  
  18. # clicking on the button
  19. button.click()

Código
  1. <a class="start-button" href="javascript:" id="convert1">
  2.                                    Start
  3.                                    <i class="fa fa-angle-right fa-5"></i>
  4.                                </a>

« Última modificación: 7 Marzo 2023, 18:44 pm por dian1919 » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Hacer click en un botón con script Python
Scripting
Splaze 0 3,068 Último mensaje 4 Octubre 2014, 16:19 pm
por Splaze
Automatizacion de selenium en Python
Scripting
ato_2k 0 2,041 Último mensaje 27 Noviembre 2020, 11:08 am
por ato_2k
Error de selenium - Python
Scripting
painpills 5 5,121 Último mensaje 18 Junio 2021, 00:36 am
por tincopasan
Nagegar con un boton a otro sitio selenium c#
.NET (C#, VB.NET, ASP)
dian1919 0 1,313 Último mensaje 26 Enero 2023, 19:44 pm
por dian1919
MOVIDO: Nagegar con un boton a otro sitio selenium c#
Programación General
fary 0 3,212 Último mensaje 26 Enero 2023, 21:39 pm
por fary
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines