【发布时间】:2021-01-31 16:06:42
【问题描述】:
我需要一个从活动单元格中读取信息并在 google 上搜索的脚本。但我不知道如何在 libreoffice calc 或 Excel 中使用 selenium 和 python 或类似的东西
Selenium 允许我进行谷歌搜索、访问网站、在表单中插入信息。所以我需要脚本来读取活动单元格并进行谷歌搜索。比如:
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome(executable_path=r"exec_path")
driver.get('https://www.google.com/')
driver.find_element_by_name("q").send_keys("active cell", Keys.RETURN)
time.sleep(15)
browser.quit()
但我希望此代码与 excel 或 libreoffice calc 的活动单元格交互,但我不知道如何。
【问题讨论】:
-
这几乎是多个不同问题的重复:1- stackoverflow.com/questions/26903304/… 2- sqa.stackexchange.com/questions/25313/… 下次尝试将您的问题拆分为更小的问题
-
这能回答你的问题吗? Reading data from a CSV file in Python
标签: python excel selenium libreoffice-calc