I'm using Selenium for Java to do some web scraping. However, I've run into a minor roadblock with what I need to do. I have a website where I want to programmatically upload an image as my avatar. What I want to do is setup a Steam profile and upload an image as my avatar through web scraping.
This is what it looks like on the website. As you can see there is a choose file button and an upload button. The upload button is a normal button
in html, and I can easily find that with selenium and do button.click();
. But, what's giving me problems is the choose file button. This is what the code looks like:
The highlighted portion of the code represents the choose file button. As you can see it's not just a button
in html, rather an input
. If you click on it it opens up a file explorer, which is out of the realm of webscraping.
Is there any way I can just choose a file from my computer and upload it directly to this input
field? Thanks!