我无法单击路由器界面中的某些按钮。我只能使用pyautogui点击浏览。但这种方法不起作用。如何在Selenium上单击此按钮?我将使用此代码重置我的ip地址
这是我要单击的位置的css代码:
<a href="#" class="edit" id="editBtn" title="Düzenle" onclick="editClick('ppp1.1', 'MyISP_PTM_35')"></a>
Html数据: https://mega.nz/file/2XJyEbCR#xBcEtzYh8QFLWTmSfAqll2V-p-SHiaw4wEz1RAWtso0
我尝试了所有的方法,但没有奏效
try:
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.CSS_SELECTOR,'#editBtn'))).send_keys("\n")
except:
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.CSS_SELECTOR,'#editBtn'))).send_keys(Keys.ENTER)
try:
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.CSS_SELECTOR,'#editBtn')))[0].send_keys("\n")
except:
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.CSS_SELECTOR,'#editBtn')))[0].send_keys(Keys.ENTER)
try:
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.CSS_SELECTOR,'#editBtn')))[0].click()
except:
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.CSS_SELECTOR,'#editBtn'))).click()
我解决了。我应该用相框的
试试这个
如果要单击链接, 也许这个例子对你有帮助
相关问题 更多 >
编程相关推荐