Home > other >  Small white for help, a drop-down box content id similar, not accurate positioning, how to solve?
Small white for help, a drop-down box content id similar, not accurate positioning, how to solve?

Time:12-13


The figure for the drop-down box part of the source code, through the python selenium can click on the drop-down box open, but the order id is discontinuous, when I am through find_element_by_xpath ("//* [@ id='15'] "). Click (), can choose the of drop-down box, but when I use find_element_by_xpath ("//* [@ id='5'] "). Click () the id=5, will be submitted to the Message: element not interactable, this, unable to locate to the id=5;
Below as the python statements, do bosses see:
 
The from the selenium import webdriver
The import time
Driver=webdriver. Chrome ()
Driver. Maximize_window ()
Driver. Implicitly_wait (5)
Driver. The get (' http://zh.xt.com/xt ')
Driver. Find_element_by_xpath ("//* [@ id='fm1']/div [1]/div/div [1]/span [2] "). Click ()
Time. Sleep (1)
Driver. Find_element_by_xpath ("//* [@ id='5'] "). Click ()

Consult everybody who this should be how to modify to pinpoint the id=5 of this article? A labyrinth, thank you thank you
  • Related