Java and the internet

Discuss how to write good code, break bad code, your current pet projects, or the best way to approach novel problems

Java and the internet

Post by Nemecek on Tue Dec 20, 2011 2:12 am
([msg=63339]see Java and the internet[/msg])

Hey,

I want to be able to make a java program that accesses a webpage and types in my information in the required fields and clicks the log in button (whether it be facebook or any other site that requires name and password) If someone has sample code I could probably teach myself or if you know how a website cause I've been looking and i can't seem to find anything or just any other suggestions or leads to go off of cause right now I'm stumped. Thanks.
Nemecek
New User
New User
 
Posts: 3
Joined: Thu Dec 08, 2011 6:39 pm
Blog: View Blog (0)


Re: Java and the internet

Post by limdis on Tue Dec 20, 2011 11:23 am
([msg=63340]see Re: Java and the internet[/msg])

I've heard of things like this before and believe it is easier than it sounds. All you would really need to do is create/edit cookies.

Here take a look at this, it's free. Is this what you are trying to do?
http://passpack.com/en/home/
"The quieter you become, the more you are able to hear..."
"Drink all the booze, hack all the things."
User avatar
limdis
Moderator
Moderator
 
Posts: 1006
Joined: Mon Jun 28, 2010 5:45 pm
Blog: View Blog (0)


Re: Java and the internet

Post by ghost107 on Tue Dec 20, 2011 7:48 pm
([msg=63344]see Re: Java and the internet[/msg])

I think learning about Http methods will help you:
http://www.jmarshall.com/easy/http/
ghost107
Poster
Poster
 
Posts: 110
Joined: Wed Jul 02, 2008 7:57 am
Blog: View Blog (0)


Re: Java and the internet

Post by Nemecek on Wed Dec 21, 2011 2:35 am
([msg=63347]see Re: Java and the internet[/msg])

limdis wrote:I've heard of things like this before and believe it is easier than it sounds. All you would really need to do is create/edit cookies.<br><br>Here take a look at this, it's free. Is this what you are trying to do?<br>http://passpack.com/en/home/


That isn't really what I'm looking for but thanks though! I've posted that I've wanted to make bots so think perhaps maybe of a gaming bot that plays an online game such as runescape, and this program has to open the webpage enter the log in information, log in and do whatever else the program was made to do.

Now I can already do this using primitive methods such as mouseclicks at specific pixel locations (Anyone familiar with java probably knows you can do this using Robot)

But now I want to the same thing but without my computer actually opening a window and clicking in specific locations. Hopefully that makes sense.

ghost107 wrote:I think learning about Http methods will help you:<br>http://www.jmarshall.com/easy/http/


I've also started learning HTML and I suppose http would be the next step if i wanted to start interacting with the internet so I'll check out that site thanks!
Nemecek
New User
New User
 
Posts: 3
Joined: Thu Dec 08, 2011 6:39 pm
Blog: View Blog (0)


Re: Java and the internet

Post by MarkIntelhunter99 on Sat Apr 07, 2012 4:12 pm
([msg=65529]see Re: Java and the internet[/msg])

You should check out Applets.

this things are programs written in java and typically designed to run from a web browser.
MarkIntelhunter99
New User
New User
 
Posts: 7
Joined: Thu Apr 05, 2012 12:48 pm
Blog: View Blog (0)


Re: Java and the internet

Post by tremor77 on Mon Apr 09, 2012 10:23 am
([msg=65558]see Re: Java and the internet[/msg])

I find this kind of thing to be easier with PHP cURL. I do believe JAVA is able to use this method..... a little something like this:

Code: Select all
HttpURLConnection con = (HttpURLConnection) new URL("https://www.example.com").openConnection();
con.setRequestMethod("POST");
con.getOutputStream().write("LOGIN".getBytes("UTF-8"));
con.getInputStream();
Image
User avatar
tremor77
Moderator
Moderator
 
Posts: 780
Joined: Wed Mar 31, 2010 12:00 pm
Location: New York
Blog: View Blog (0)


Re: Java and the internet

Post by centip3de on Mon Apr 09, 2012 8:13 pm
([msg=65567]see Re: Java and the internet[/msg])

MarkIntelhunter99 wrote:You should check out Applets.

this things are programs written in java and typically designed to run from a web browser.


Once again, please don't necro old posts.

tremor77 wrote:I find this kind of thing to be easier with PHP cURL. I do believe JAVA is able to use this method..... a little something like this:<br><br>
Code: Select all
HttpURLConnection con = (HttpURLConnection) new URL("https://www.example.com").openConnection();<br>con.setRequestMethod("POST");<br>con.getOutputStream().write("LOGIN".getBytes("UTF-8"));<br>con.getInputStream();


Once again, +1 for content, -1 for feeding
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rick Cook
User avatar
centip3de
Moderator
Moderator
 
Posts: 1237
Joined: Fri Aug 20, 2010 5:46 pm
Blog: View Blog (0)


Re: Java and the internet

Post by tremor77 on Tue Apr 10, 2012 10:29 am
([msg=65569]see Re: Java and the internet[/msg])

derp - never even checked the OP date.
Image
User avatar
tremor77
Moderator
Moderator
 
Posts: 780
Joined: Wed Mar 31, 2010 12:00 pm
Location: New York
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests