How can I click on button in a html page with JAVA? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can I click on button in a html page with JAVA?

I want to create an Android app to download mp3 file from an url. Initially the user must type the video url and when he presses a button, it completes another url (http://convert2mp3.net/share.php?url=%videoURL%), but the site hasn't created the file yet and it asks user to select mp3 tags like author's name and when the user clicks on "continue" button, the site shows the button to download the mp3 file. I know how to complete the url, download the file and storage it, but I don't know how to click on "continue" button in the tags page. Can anyone help me?

15th Jan 2017, 3:28 PM
Gianluca Acerbis
Gianluca Acerbis - avatar
1 Answer
0
Without attempting this I can't give you a direct answer on how to do it. However I'll provide the advice I can. First: The website: https://www.youtubeinmp3.com/api Provides a web api that can construct a direct download link. I don't know if that differs from what you are currently attempting. Second: If you must wait for a file to be created, or wait for anything in general, you should be using callbacks/asynchronous methods. Third: If those aren't enough and you must perform that click, the best way to do so would be to somehow load that page, perhaps with a webview, and to run JavaScript on it, JavaScript is capable of using its click function, to simulate a mouse click on a particular html element.
17th Jan 2017, 5:23 AM
Thomas McSherry
Thomas McSherry - avatar