0

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.

enter image description here

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:

enter image description here

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!

Scooter
  • 1,031
  • 1
  • 14
  • 33
  • Your question is well formatted and clear... the only piece missing is what you have tried. Please post some code samples of what you have tried and what the result was so we can better help you. Also, have you googled this question? I'm pretty sure this is a duplicate. – JeffC Sep 12 '15 at 15:39
  • Yeah I didn't look into it that much. That's my fault, I'll look at the answer to the other question and see if it's appropriate for what I'm doing. Thanks for the reply. – Scooter Sep 12 '15 at 16:28

0 Answers0