Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Selenium+js operation

Shulou Source: shulou.com Published: 2022-06-03 07:13:26 11月23日 Update

# method 1: selenium can successfully locate the element, and arguments [0] corresponds to WebElement. * * kwargs corresponds to the parameters in js js = "arguments [0] [xss_clean] = arguments [1]" self.__driver.execute_script (js, WebElement) * * kwargs) # method 2: use js to locate elements and process js = 'document.getElementsByClassName ("site-nav-right fr") [0] .childNodes [1] .removeAttribute ("target")' self.__driver.execute_script (js) # js through xpath positioning element # document.evaluate ('/ / div [@ class= "staffList-header"] / / button [@ class= "button-block"]') .Attribute ()

Tags: Elements positioning methods success parameters processing Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Linux Microsoft Shulou Technology Shulou Information