I’m trying to create a script that will upload a file to a website. I have no control of the website so the file has to be uploaded via clicking and typing.
Aka,
- wait for upload window to pop up
- type name/path of file
- click “Open” or “upload” (or whatever) button
Because the window is part of the OS (not a browser window), I can’t control it with Selenium or something like that (as far as I know. Plz let me know if I am wrong). This means I need the script to do this.
I already have it working for Windows (made it with AutoIt) however, I also need it to run on Unix systems (Linux).
So I’m asking, is there a way to do it with Python or something? If I can make one script that will run on both, that would be awesome (AutoIt is Windows-only).
I have knowledge of Java, Python and AutoIt, but if none of those can do it, I can learn something else.
Thanks.
EDIT:
Ok, so apparently using HTTP POST is the way to do it, however I am not sure how to do this. I’m going to do more research on that. Thx @Chrules for bring this to my attention.
Now that you want to do it via an HTTP request, the Requests library is highly recommended.
It is really that simple: