Results 1 to 2 of 2
  1. #1
    shanoger is offline Member
    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0

    Default Problem with Sockets

    Hello every one... i writing a simple program that would do a "GET" one a web site (in my case it is torrentz.eu). I get several problems:
    1. the html dump with my code is not the same as what i see on the browser
    2. how can i access or use the search text box, i mean how can i with a java code do some thing like search a movie name and retrieve results (by retrieve i mean see the result html page as per search)

    here is my code

    Java Code:
    package getmethod;
    // HTTP GET through socket, not through "URL" class
    import HTTPstuff.*;
    import java.net.*;
    import java.io.*;
    
    public class Main
    {
    
      public static void main ( String[] args )
      {
        getPage gt = new getPage();
    
        try
        {
            gt.getPageSourceCode();
        }
    
        catch (UnknownHostException e) {}
        catch (IOException e) {}
    
    
    
      }
    }
    I tried doing a get with the link that appears on the address bar of the browser after a do a search with the site (say torrentz.eu). I would really appreciate any help, thanks in advance...

  2. #2
    shanoger is offline Member
    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0

    Default Thank you for the reply

    wow thats a lot of useful in the future information.... really no sarcasm i appreciate your effort in explaining various details of sockets and their use... i figured out the problem i had with my code , well i simply ditched the socket class and used the URL class which in turn was a lot easier to use. Not to say i didnt try fix what was wrong with the previous class, i did and the problem was with the header i sent along with the GET. Once again thank you for your help :).

Similar Threads

  1. Problem with Sockets
    By pinheiroa in forum Networking
    Replies: 15
    Last Post: 09-05-2010, 10:53 PM
  2. Replies: 6
    Last Post: 11-18-2009, 11:39 PM
  3. TCP sockets problem
    By duffman.sk in forum Networking
    Replies: 1
    Last Post: 10-30-2009, 05:06 AM
  4. Problem (sockets)
    By Blacknight962 in forum New To Java
    Replies: 3
    Last Post: 08-16-2009, 12:56 AM
  5. Sockets and JFrames problem
    By marcg11 in forum Advanced Java
    Replies: 6
    Last Post: 08-15-2009, 01:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •