0

How to upload image files to google keep using selenium.

Please reply as soon as possible.

I have tried to find the hidden input tag but it was unsuccessful and I don't want to use pyautogui or any other GUI automation framework JUST SELENIUM.

Please reply as soon as possible.

1 Answers1

1

Question is unclear. Selenium can't programmatically upload anything, you'd need a request framework to hit the Google Keep API (if there is one) to do that.

You can use Selenium to navigate the DOM of Google Keep and follow the exact same process as you would by doing it manually. However, once you're trying to find the files on disk, the prompt for this is no longer part of the DOM - I do not believe selenium can interact with this, it would still require manual intervention.

Based on this answer, and the other answers to the same question, https://stackoverflow.com/a/8852686/7532703 - it seems like people have had luck using AutoIT.

Edit from the comments:

I found this https://stackoverflow.com/a/33526707/7532703 - which uses a combination of Selenium and C# to interact with the dialog window, you'd have to either do this in C# or find something that you can do the same thing with in python

Psibean
  • 153
  • 1
  • 10
  • Sure I'm trying to upload an Image file from my local hard disk to google keep – adithya sherwood Jan 01 '21 at 08:21
  • Right, Selenium only interacts with the DOM. Once you're presented with the file selection dialog, that is part of your file explorer, it has nothing to do with the DOM. This is not something Selenium can interact with. Edit: if a file upload has a text input alongside it, you can grab that and send the absolute file path of your intended file, but an actual file explorer dialog is outside of Selenium's reach. – Psibean Jan 01 '21 at 08:26
  • Thanks Do you know any other way of uploading image file to google keep – adithya sherwood Jan 01 '21 at 08:30
  • I found this https://stackoverflow.com/a/33526707/7532703 - which uses a combination of Selenium and C# to interact with the dialog window, you'd have to either do this in C# or find something that you can do the same thing with in python. – Psibean Jan 01 '21 at 08:32
  • Good luck and feel free to come back with any useful information you find, I've updated my main response with some additional information. – Psibean Jan 01 '21 at 08:38
  • 1
    Thanks, I have fixed my problem! – adithya sherwood Jan 06 '21 at 13:50
  • Feel free to elaborate in detail on how, either here, or as another answer! – Psibean Jan 12 '21 at 10:39