如何使用<a>pythonSelenium双击标签



我想抓取网站上的数据。但我有一个问题,
我想双击标签
谁知道这件事?如果你知道这一点,请帮帮我

我的代码:

<a href="#product-lists id='products'">

如果你知道的话,请帮帮我。感谢

path='//a[@href="{}"]'.format("#product-lists id='products'")
print(path)
from selenium.webdriver import ActionChains
source = driver.find_element_by_xpath(path)
action = ActionChains(driver)
action.double_click(source).perform()

你的href值看起来真的很糟糕,但要双击元素的href值,请使用动作生成器并找到具有该值的href值。

最新更新