• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

[HELP] How to login to a website and get XML data of that site

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm trying to login to a website, named Maxithlon.com, to get xml data from that site. So I can make a program for the users. The only problem is, I can't get the connection.

This is the login string query: http://www.maxithlon.com/maxi-xml/login.php?user=Gynnad&scode=1q2w3e4r
Where Gynnad is the username and 1q2w3e4r is the securitycode.

First I thought it was a POST-method but it isn't, so this code isn't right, but is what i had:



and this was the result of that code:



Can someone help me with a explanation/tutorial or something?

Thanks!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the login works via GET, why are you trying to use POST? Do you have any indication that that should work?
 
Sheriff
Posts: 22850
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The page apparently doesn't accept POST requests; it does accept GET requests. Just put the parameters in the URL:

Usually I'd suggest to not post read passwords, but in this case we wouldn't be able to test any solutions without it. I do suggest you to change it as soon as possible after finding a proper solution though.
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:The page apparently doesn't accept POST requests; it does accept GET requests. Just put the parameters in the URL:

Usually I'd suggest to not post read passwords, but in this case we wouldn't be able to test any solutions without it. I do suggest you to change it as soon as possible after finding a proper solution though.





Now it works to login, now i'm going to set some cookies so I can go to another website and get the content of that page. I will post that also here. If you have some comments please give them so I can learn about it!

The password is not the real password of the page, it is a securitycode and you can only access the pages with the xml, not the game.
 
Marshal
Posts: 80760
487
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

That question looks too difficult for us here on "beginning"; shall move it. Not sure whether to "servlets" in view of POST and GET, maybe I'll try "in general" and let Rob move it again if he thinks appropriate.
 
Rob Spoor
Sheriff
Posts: 22850
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nah, it's good here. But you could also have considered Sockets and Internet Protocols
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Now I have this, with this output:


So I understand this page has 2 cookies, but witch one should I use and how can I go now to another webpage?
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Ok, with the second cookie the connection works! So now I will make the code a bit clearer and only use the 2th cookie. Someone has any tips for me?
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I now see if the user is sign in? Because the website returns always a Cookie. So I can't check if the cookie is null.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic