i’m new in selenium developing and i need to “scrape” this page:
https://annunci.ebay.it/pubblica-annuncio
in this page there is an images upload using jquery. i need to do the same using selenium in java. can someone give me some suggests? thanks!! 🙂
This is what i try:
WebDriver d = new FirefoxDriver();
d.get("https://annunci.ebay.it/pubblica-annuncio");
List<WebElement> elements = d.findElements(By.tagName("input"));
for(WebElement e : elements){
System.out.println(e.getAttribute("name"));
}
If I understand your question right, you want to upload a file there, is that correct? This should do the trick:
The idea is to directly send the path to the file to an element which you would usually click at to get the modal window – that is
<input type='file' />element.Because most of those file upload inputs have some
onchangeevent trigger, you should be able to fire those. According to WebDriver FAQ, there is a simple solution for this so you don’t have to fire all those events manually: