Selenium+js operation
# 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 ()