Play Now Login Create Account
illyriad
  New Posts New Posts RSS Feed - Accessing Pages Programatically
  FAQ FAQ  Forum Search   Register Register  Login Login

Topic ClosedAccessing Pages Programatically

 Post Reply Post Reply Page  <12
Author
matiez View Drop Down
New Poster
New Poster


Joined: 31 Oct 2011
Status: Offline
Points: 30
Direct Link To This Post Posted: 20 Jan 2012 at 18:08
I am developing a personal application that requires pulling data from the HTML pages. When the user presses a button the application will log in, parse for information, and report back. I have successfully logged in programatically. I am having issues actually reaching the data pages, though.

The URL fragments (i.e. #/Towns/Castle) are whats tripping me up. Can anyone help me with how to access these fragment pages from within Java code? The following code example returns a "Resource not found" response.

        String url2 = URLEncoder.encode("#");
        HttpPost httppost = new HttpPost("http://elgea.illyriad.co.uk/"+url2+"/Town/Castle");
        CookieSpecBase cookieSpecBase = new BrowserCompatSpec();
        List<Header> cookieHeader = cookieSpecBase.formatCookies(cookies);
        httppost.setHeader(cookieHeader.get(0));
        HttpResponse response;

        try {
            response = client.execute(httppost);
        } catch( Exception e) {}

Edit: The personal application will be made public after a potential future release from the developers, since it is against policy to request for Uname and Pwd.


Edited by matiez - 20 Jan 2012 at 18:10
Back to Top
 Post Reply Post Reply Page  <12
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.