Python selenium - modifying the source code of a webpage

前端 未结 3 1600
暗喜
暗喜 2021-02-10 06:15

I am using Python selenium to automate my attendance entry. It was working fine, now I wanted to try by modifying the source code. I have seen few posts stating that it can be m

3条回答
  •  梦毁少年i
    2021-02-10 06:38

    Try following solution and let me know if any issues occurs:

    driver.execute_script("""document.querySelector("select[name='date1'] option").value="2016-09-07";""")
    

    P.S. I advise you not to use absolute XPath in your selectors, but relative instead

提交回复
热议问题