Python Forum
Netgear router automatically using selenium
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Netgear router automatically using selenium
#1
So I'm trying to log onto my Netgear router automatically using selenium

I was successful in doing so

What I'm trying to add to it is the ability
to click on ADVANCED tab

driver.find_element(By.TAG_NAME, "ADVANCED").click()

I have tried using
By.XPATH,
By.LINK_TEXT,
By.TAG_NAME,
I've tried them all with no success nothing actually happens
can anyone help me to figure out what I'm doing wrong

from selenium import webdriver
from selenium.webdriver import Keys
from selenium.webdriver.common.by import By
import time

from selenium.webdriver.common.devtools.v125 import browser

driver = webdriver.ChromeOptions()
driver.add_argument("--start-maximized")
driver.add_experimental_option("detach", True)
driver = webdriver.Chrome(options=driver)

# router information
#url = 'http://'
username = ''
password = ''
ip = ''

driver.get('http://' + username + ':' + password + '@' + ip)

driver.find_element(By.TAG_NAME, "ADVANCED")..click()
When I right-click on ADVANCED and then on insects
this is what I get


<a id="AdvanceTab" onfocus="this.blur()" href="#" style="background: url(&quot;../img/tab-nonactive.gif&quot;) 0px center no-repeat;"><span>ADVANCED</span></a>

<span>ADVANCED</span>
Reply
#2
tag names are things like 'a', 'div', 'span'. You should just select it by id, in your case AdvanceTab

driver.find_element(By.ID, "AdvanceTab")
Reply
#3
(Aug-18-2024, 05:03 PM)acidcoder Wrote: tag names are things like 'a', 'div', 'span'. You should just select it by id, in your case AdvanceTab

driver.find_element(By.ID, "AdvanceTab")

Thanks for the input I will certainly try that
Reply
#4
Could there be any JavaScript or event handlers preventing the click action from registering, and how might you troubleshoot that within your Selenium script?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Router interface status through SNMP - suggestion required for improvement. anna 0 3,766 Feb-27-2018, 11:10 AM
Last Post: anna

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020