The selenium in python reports an error after clicking.

clipboard.png

  click_link=self.driver.find_element_by_xpath("//form[@id="form"]").click()
                -sharp time.sleep(5)
                link=self.driver.find_element_by_xpath("//form/input[4]/@value")

the error is as follows:
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: The result of the xpath expression "/ / form/input [4] / @ value" is: [object Attr]. It should be an element.
(Session info: headless chrome=66.0.3359.181)

Mar.28,2021

link=self.driver.find_element_by_xpath('//form/input[4]/@value')

remove @ value, and navigate to the element instead of getting the value

Menu