登录百度网盘后,我想一次选定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没有处于选定状态。

请问,如何同时选择多个文件?

Logo

GitCode 天启AI是一款由 GitCode 团队打造的智能助手,基于先进的LLM(大语言模型)与多智能体 Agent 技术构建,致力于为用户提供高效、智能、多模态的创作与开发支持。它不仅支持自然语言对话,还具备处理文件、生成 PPT、撰写分析报告、开发 Web 应用等多项能力,真正做到“一句话,让 Al帮你完成复杂任务”。

更多推荐