Python with selenium: unable to locate element which really exist

后端 未结 2 1940
渐次进展
渐次进展 2020-12-08 04:25

I\'ve been trying fill input:



        
相关标签:
2条回答
  • 2020-12-08 05:23

    Add some delay to the driver so that elements will load.

    import time
    time.sleep(2)
    department_element = driver.find_elements_by_id("__id_name__")
    
    0 讨论(0)
  • 2020-12-08 05:32

    The problem is that your input tag is inside an iframe, you need to switch to it first:

    frame = driver.find_element_by_xpath('//frame[@name="main"]')
    driver.switch_to.frame(frame)
    pass1 = driver.find_element_by_id("PASSFIELD1")
    
    0 讨论(0)
提交回复
热议问题