Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I've slightly modified (messed) your code and it works now...
Or at least it seems to work,
(My german doesn't allow me to be 100% affirmative)
I've printed the last reached page for you can check it.

Take note of the 'id' parameter passed on the url when you connect to the site.
It's a 'session id', It changes with each connexion.
when you use an 'id' that you got long before (and the password associated to this 'session id' the session is no longer valid, and you get the message telling 'you haven't been connected for too long' (Or something like that, my german isn't what it was supposed to be.))

BTW your User Agent is not a valid one
(something like :
"Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"
is more common)
and in this case is useless.

I've leaved the debugging code (printing MATCH)
to show you that the id value changes every time...

the regex are ugly (please japhy don't hit me hard) but were just done to test it. In a real code you'll have to harden them...
use LWP::UserAgent; my $hdrs = new HTTP::Headers('Accept' => 'text/plain', 'User-Agent' => + 'IE/5.0'); my $ua = new LWP::UserAgent; $page=get_url(''); if ($page=~ /content="\d+;url=([^"]+)/m) { print "\n\n*********MATCH($1)*******\n\n"; $page=get_url("$1"); } else { print "redirect not found !"; } if ($page=~ /location.href="([^"]+)"/s) { print "\n\n*********MATCH2($1)*******\n\n"; $page=get_url("$1&page=loginp&nickname=J +ohnSmith&password=test&x=0&y +=0"); } else { print "redirect not found !"; } print $page; if ($page=~ /main.location.replace\("([^"]+)"/s) { print "\n\n*********MATCH3($1)*******\n\n"; $page=get_url("$1&page=loginp&nickname=J +ohnSmith&password=test&x=0&y +=0"); } else { print "redirect not found !"; } print $page; sub get_url() { my $url2get = shift @_; my $url = new URI::URL($url2get); my $req = new HTTP::Request('GET', $url, $hdrs); my $resp = $ua->request($req); if ($resp->is_success) { return $resp->content;} else { return $resp->message;} }

In reply to Solution for your problem with LWP, frames, login, and parent.main.location.replace() by arhuman
in thread Problem with LWP, frames, login, and parent.main.location.replace() by BinBerliner

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (3)
    As of 2020-12-01 03:44 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found