0

Background:

  1. Programming in Python (vscode)
  2. on Mac

Story: I am using selenium to automate a process and at some point throughout that process I have to upload a picture. I can click on the "from Computer" button that pops up but this opens the finder with all my files/documents. I do not know how I could tell python here to navigate to a given folder and klick "submit" (or upload). Question: Does anyone know a way to "control" the finder similarly to what selenium does for the web browser?

Thank you!

I have tried:

  1. Selenium but it can not handle this (to my knowledge) since I am no longer in the browser.
  2. I have also tried the package pyautogui but because I would like to be able to run the same program from several computers (the path will be the same) but they display the finder differently so I dont think that will do the trick.
Max
  • 33
  • 1
  • 3
  • You are thinking of this visually when you should be thinking of it textually (unless you are trying to animate what is happening, which is a different problem). Instead of trying to open and click things, see if you can use shell commands to navigate to where you want to go, and upload from there. Maybe [this](https://stackoverflow.com/questions/434597/open-document-with-default-os-application-in-python-both-in-windows-and-mac-os) is a start? – sami-amer Dec 30 '22 at 00:58

0 Answers0