r/pythontips • u/Responsible-Dig7538 • Sep 17 '24
Module Automate task that involves opening Power BI file, performing mouse operation, saving file, uploading it to a website.
Hello,
I'd like to know if there is a way to automate the following task, and schedule it to perform daily at a fixed time on an already setup vm.
- Open PowerBI file
- click on "Refresh" button.
- Wait until Refresh is done (I'm able to come up with an upper bound as to how long this could possibly take.
- Save the file and close PowerBI
- Go to a specified web URL
- Enter login details
- Click "Replace"
- Choose file
- Click OK
- Wait till upload is finished
- Close everything
Especially steps 1-5 give me some worry as to how to implement them. Can anyone give me some guidance on what to use to implement these steps? (Also, is the stuff used in this video "playwright" good for the second half of steps?)
4
Upvotes
1
u/eletroom Sep 17 '24
Why can't you use the refresh in the pbi service? I mean it's all possible to automate, but it seems like you have some things to fix in your power bi data load.
1
u/eztaban Sep 17 '24
I haven't done this stuff myself, but have a look at PyAutoGUI and selenium. Corey Schafer on YouTube has some good videos in selenium, and I guess you can find the PyAutiGUI stuff on YouTube as well.
0
u/[deleted] Sep 17 '24
[deleted] — view deleted comment