1
I’m studying a book Automate Massive Tasks with Python. I’m on page 317 that talks about Selenium Webdriver on the methods of finding elements on the pages.
Table 11.3 - Selenium’s Webdriver methods for finding elements. After making this small example below I stopped/impaled when clicking on the Wireles link on the left side of the page. Because I noticed that the link is part of a frame and the same "is not found" on the current page. Wireless Router N 300mbps WR840N model TL-WR840N.
#Importando selenium
from selenium import webdriver
#Importando as teclas especiais {ENTER}{TAB}{DOWN}...
from selenium.webdriver.common.keys import Keys
#Escolhendo o browser padrao
browser=webdriver.Chrome()
#abrindo o endereco do roteador
browser.get('http://192.168.100.1')
#maximizando a janela atual
browser.maximize_window()
#Digitando o usuario
browser.find_element_by_id('userName').send_keys('admin')
#Digitando a senha
browser.find_element_by_id('pcPassword').send_keys('admin')
#Clicando no botao Login
browser.find_element_by_id('loginBtn').click()