I'm currently working on an Instagram bot and want to upload pictures using selenium. I'm emulating a phone in my selenium, but everytime I click on the upload button, Explorer opens and wants me to select the pictures manually.
Is there a way to bypass that to have picture uploads automated?
Asked
Active
Viewed 1,181 times
0

SherylHohman
- 16,580
- 17
- 88
- 94

Luis Wiederhold
- 1
- 1
2 Answers
1
Selenium is simply a web Automator and is of no use for handling file selectors, or any of that kind that is distinct from web functionalities.
That being said, I do believe this can be solved by using a library called Sikuli
. See this article on the use of this and how you can incorporate this into your script. Also see this answers for How to use Sikuli with Selenium in Python?
The other way is to of-course use the API
.

AzyCrw4282
- 7,222
- 5
- 19
- 35
0
I was able to upload pictures on instagram from python using a library called instabot
Then did the following:
from instabot import Bot
bot = Bot()
bot.login(username=USERNAME, password=PASSWORD)
bot.upload_photo(IMAGE_PATH, caption="Follow me on instagram! :D")
Note: you might get an error when running the script more than once. To overcome this, you might want to delete your config
folder. Or make a script that automates such task.

SherylHohman
- 16,580
- 17
- 88
- 94

Anas2020
- 5