I am attempting to semi-automate my department's workflow, and part of it includes this project I'm doing. The sections I am currently struggling with is "clicking" a button on a webpage.
The webpage has data in a grid (looks like an Excel sheet) and has multiple pages that I want to parse out and use as data for the automation, and there is a button on the webpage that, when clicked, converts all the pages of that data into an Excel sheet and saves it where I need on my computer. I want to constantly update that Excel sheet with the changes as more data is added to the webpage.
However, I do not want to always have that webpage open and have automatic button presses that constantly saves the webpage to Excel. Rather, I want to have it running "in the background" so the only progress I see is the Excel sheet getting updated. Is there a way to "click" that 'Convert to Excel' button without actually going on the webpage to do it?
I was looking at Python libraries like Requests and bs4, but I'm not sure which methods might be applicable for this, if those are even what I should be looking for.
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("http://example.com")
button = driver.find_element_by_id('buttonID')
button.click()
What you want is called a robot and for Python I highly recommend looking into Selenium. Just google for python selenium tutorial
or start by reading this: https://selenium-python.readthedocs.io/getting-started.html#simple-usage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With