August 7th, 2013, 12:02 AM
Is PHP Optimal for This?
Hey everybody thanks for taking the time,
I'm super new to coding and a friend mentioned that PHP may be helpful for this - and java as well.
I'd like to know which programming language would be best suited to make a program that can do the following things
1. Open a browser and go to a specific URL
2. Click on a button on the page to 'upload' a file, and select the proper file from my documents
That's essentially the jist of the functions, if you know which language may be suitable, and what you perceive the level of difficulty to be, please fill me in!
I'd really appreciate it,
August 7th, 2013, 12:13 AM
It looks like you wish to emulate a web browser. I have no idea if there is a package to do this. I don't think that PHP would do the job.
August 7th, 2013, 12:21 AM
perhaps not emulate a web browser, but just be able to open one and then identify what on the screen to click and in what order. sort of like a macro mouse sequence but more complex. thank you very much
Originally Posted by richpri
August 7th, 2013, 12:25 AM
PHP is a type of file that is ran on a server. For example XAMPP, WAMP, or from a hosting a provider. You will not be able to open a web browser with PHP. PHP is a backend type of script, that is again, hosted on a server.
Java would be more suitable in this case. You could indeed create a browser with Java and then navigate to a webpage.
Hope that helped!
August 7th, 2013, 12:27 AM
Thanks a ton and I'm over to the Java forum!
Originally Posted by tjswebdev
August 7th, 2013, 12:32 AM
PHP runs on a web server not on a browser.
August 7th, 2013, 12:36 AM
August 7th, 2013, 07:07 AM
However, if you are trying to automate a task on your desktop then i can recommend the iMacros plugin for firefox. If you have a lot of files then you can use php to write the macroscript (you can generate a sample one from running it manually) or work out how to get iMacros to read from a CSV
August 7th, 2013, 07:48 AM
August 7th, 2013, 08:34 AM
Originally Posted by richpri
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.
August 7th, 2013, 12:12 PM
I'm a little confused by the other responses.. maybe they're being a bit too literal.
Originally Posted by taevo
It sounds like what you're specifically trying to do is simply automate the upload of a local file through a web form of a website.
Opening the website in a browser, clicking an upload button, and selecting the file is the very human way of doing it, but there might be more direct automated ways available to you.
For instance, you could use a programming language to build an HTTP POST request to the same destination the form would submit to, including the desired file for upload. The mechanics to do that specifically vary by language, but the concept is common.
So then the question becomes which language would be best for it, and really a lot of them could. Personal experience would have me say that PHP isn't a perfect fit for Windows, but personal experience has also shown how much of pain in the *** Java can be to get configured correctly for development and use. C# would probably be the easiest to use but I think you'd have to pay for it.
So all in all... I'd still push for the use of PHP in your case.
August 7th, 2013, 12:20 PM
Yep, this too - I forgot to mention this after my introduction to macros. Thanks to Dave for adding it in
Originally Posted by dmittner
August 8th, 2013, 11:47 AM