登录百度网盘后,我想一次选定2个文件
方法1:
path1 = driver.find_element_by_xpath('//a[@title="test1"]')
ActionChains(driver).move_to_element(path1).perform()
ActionChains(driver).context_click(path1).perform()
path2 = driver.find_element_by_xpath('//a[@title="test2"]')
ActionChains(driver).move_to_element(path2).perform()
ActionChains(driver).context_click(path2).perform()
方法2:
path = driver.find_element_by_xpath('//a[@title="test1"]|//a[@title="test2"]')
ActionChains(driver).move_to_element(path).perform()
ActionChains(driver).context_click(path).perform()
方法3:
path = driver.find_element_by_xpath('//a[@title="test1"or @title="test2"]')
ActionChains(driver).move_to_element(path).perform()
ActionChains(driver).context_click(path).perform()
三种方法都不行,运行后,发现只能选定最后一个文件test2 ,test1没有处于选定状态。
请问,如何同时选择多个文件?