0

I need a script that reads the information from the active cell and searches on google. But I have no idea how to use selenium with python or something like that in libreoffice calc or Excel

Selenium allows me to do google searches, access websites, insert information in forms. So I need the script to read the active cell and do a google search. Something like:

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()

But I want this code to interact with the active cell of excel or libreoffice calc and i don't know how.

catarse
  • 1
  • 4
  • This is pretty much a duplicate of separate questions: 1- https://stackoverflow.com/questions/26903304/reading-data-from-a-csv-file-in-python 2- https://sqa.stackexchange.com/questions/25313/how-to-click-on-search-button-in-google-search-using-selenium/37451 Try to split your problems into smaller problems next time – FlyingZipper Jan 31 '21 at 19:18
  • Does this answer your question? [Reading data from a CSV file in Python](https://stackoverflow.com/questions/26903304/reading-data-from-a-csv-file-in-python) – FlyingZipper Jan 31 '21 at 19:20

2 Answers2

0

What Selenium can do? It can help you with web related steps of your business problem. Are you thinking about LibreOffice online? If not - Selenium cannot help you with desktop apps.

How to start with selenium: https://www.selenium.dev/documentation/en/getting_started/quick/

How to interact with LibreOffice Calc files using python: Using Python to access LibreOffice Calc using Uno

Piotr M.
  • 385
  • 2
  • 8
0

Yes it's now possible in LibreOffice Calc to drive Python Requests and Selenium. You must install the OAuth2OOo extension. Enjoy....

More informations:

Disclaimer: I am the developer of the CalcAddIns.

psilocybe
  • 35
  • 6