Python script uploads a file to website but when ran through EM nothing happens

I have a script that goes to a vendor’s website and logs-in with a username and password and then uploads a file for their consumption. The code works when I run it in my python editor but when i run it through EasyMorph it gets to the upload screen and then nothing happens but the script doesnt fail it successfully runs. Any ideas why it’s not working?

Hi Ethan and welcome to the Community!

A few questions:

  1. How do you know it’s getting to the upload screen?
  2. How do you know it successfully runs?
  3. Did you try to run the script from the command line under the same Windows account that is used by EasyMorph (I suppose yours)?

Finally, did you consider uploading the file using EasyMorph? In the “Web request” action it is possible to specify the request body as a file. It doesn’t work for multi-part uploads, but in some cases might work.

  1. When I run the Python script through EasyMorph I have it login to the vendor’s website using Selenium, then navigate to the upload page and then I’m having it sleep on the upload/input page before it’s supposed to send the file (so I can verify it made it that far)
  2. I say it successfully runs in that no error pops up in EasyMorph and i added a random print statement line right after the command to send the file to the site and while the file doesnt get uploaded to the site, the print line executes and returns in EM after
  3. I hadn’t tried this until now and it does the same thing as when it’s ran through EasyMorph (does everything it’s supposed to except actually upload the file)

I initially tried using a Web Request action but I couldnt seem to figure that out/get that to work too I’m not sure if it’s because the site is in javascript or what lol but i thought this alternative might be easier but now I’m stuck this way too!

I got it to work! It seems the issue was that I wasn’t giving the script enough time to execute the file upload before it closed out the browser - thank you for your help!

1 Like

You’re welcome!