Ask a Question related to PERL Miscellaneous, Design and Development.
-
danglesocket #1
not able to access a URL with LWP::UserAgent.
I need to solve this problem with perl, forgive me if it stretches the
'params' of this group. thanks
This problem originated from not being able to access a URL with
LWP::UserAgent.
Error, cant get page [url]https://webpage.jsp[/url] -- 302 Moved Temporarily
Aborting at ./curu.pl line 77.
(sorry it's an intranet page,... not available outside)
(yes, i am also using use Crypt::SSLeay for SSL support)
I can access the url/page fine from any GUI browser.
I thought to check lynx: (my only other 'text' based http protocol resource.
(lynx -version has ssl support)
# lynx: Can't access startfile [url]https://webpage.jsp[/url]
# HTTP/1.1 302 Moved Temporarily
# Data transfer complete
# HTTP/1.1 302 Moved Temporarily
# Alert!: Redirection limit of 10 URL's reached.
I know this is because of a redirection loop at the start of the url. how
can i write around this?
I even have found out where it's get's re-directed and tried to acces that
directly, no success.
So i can not access the page from any 'text' based script or browser. (?!)
As im reading this, it sounds like a https protocal issue (or ssl) and not a
perl issue but i really
have to solve this issue with perl. - I have to be able to access this page
wtih perl, any ideas?
thank you.
__danglesocket__
danglesocket Guest
-
LWP::UserAgent and HTTP_ACCEPT
I want to accept only certain mime types with LWP::UserAgent. What is the most failsafe way to do this? I doubt that sending an accept header is... -
Not able to use LWP::UserAgent::Authenticated
Hi All when i am trying to use my $ua = LWP::UserAgent::Authenticated->new( $LOGINID, $PASSWORD ); its giving me error Can't locate... -
URGENT: no response - LWP::UserAgent
Hi, I was using the LWP::UserAgent module for about 4 month with no problems, sudenly it stopped working. Nothing has been changed. I tested the... -
Problems with LWP::UserAgent
I am trying to create a spider to grab my books off of Safari for a batch printing job so I don't need to go through each chapter myself and... -
'LWP::UserAgent' does not get any page
Hello. I'm trying to get the content of yahoo.com (I tried with other URLs). I run this script on a Linux PC. ... -
Brian Harnish #2
Re: not able to access a URL with LWP::UserAgent.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, 11 Sep 2003 12:57:02 -0400, danglesocket wrote:
[snip...]> I need to solve this problem with perl, forgive me if it stretches the
> 'params' of this group. thanks
>
> This problem originated from not being able to access a URL with
> LWP::UserAgent.
>
> Error, cant get page [url]https://webpage.jsp[/url] -- 302 Moved Temporarily
Try a real URL. Looks like your server is "webpage.jsp", can
you "ping webpage.jsp"? If not then your url is bad. Also, if that is the
server name, try putting a '/' on the end of it, thats the way it should
be.
[snip 6 blank lines before your name...]> thank you.- Brian> __danglesocket__
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE/YLauiK/rA3tCpFYRAmLoAKCZB7obGtoi04JqftbmUh4YgvAT6ACfU0ns
rtK7cykR8UTUKWqxCSu6o9A=
=2dX8
-----END PGP SIGNATURE-----
Brian Harnish Guest
-
danglesocket #3
Re: not able to access a URL with LWP::UserAgent.
On Thu, 11 Sep 2003 12:57:02 -0400, danglesocket wrote:
[snip...]> I need to solve this problem with perl, forgive me if it stretches the
> 'params' of this group. thanks
>
> This problem originated from not being able to access a URL with
> LWP::UserAgent.
>
> Error, cant get page [url]https://webpage.jsp[/url] -- 302 Moved Temporarily
Try a real URL. Looks like your server is "webpage.jsp", can
you "ping webpage.jsp"? If not then your url is bad. Also, if that is the
server name, try putting a '/' on the end of it, thats the way it should
be.
Rather than responding with a half assed answer that proves that you didn't
read the question and
tries to make me look like an idiot, either don't respond or offer somthing
more 'insightful'.
original post stated, "I can access the url/page fine from any GUI
browser." and that
(sorry it's an intranet page,... not available outside)
-how would i be able to do that if this was a simple non-existant url
issue.
[url]https://webpage.jsp[/url] - i thought it was clear that this was an example, not a
real url, sorry if that wasn't clear.
- i guess i should have used [url]https://example.org/webpage.jsp[/url]. - RFC 2606,
Section 3.
or [url]https://localhost/webpage.jsp[/url]
thanks anyway.
__danglesocket__
danglesocket Guest
-
Brian Harnish #4
Re: not able to access a URL with LWP::UserAgent.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, 11 Sep 2003 15:31:49 -0400, danglesocket wrote:I read the question. It's often easiest to help solve the problem when you> Rather than responding with a half assed answer that proves that you didn't
> read the question and
> tries to make me look like an idiot, either don't respond or offer somthing
> more 'insightful'.
>
> original post stated, "I can access the url/page fine from any GUI
> browser." and that
> (sorry it's an intranet page,... not available outside)
>
> -how would i be able to do that if this was a simple non-existant url
> issue.
> [url]https://webpage.jsp[/url] - i thought it was clear that this was an example, not a
> real url, sorry if that wasn't clear.
>
> - i guess i should have used [url]https://example.org/webpage.jsp[/url]. - RFC 2606,
> Section 3.
> or [url]https://localhost/webpage.jsp[/url]
know what all the variables are in the problem. Perhaps the problem is
with your url (not the one you said, but the one you really did use) and
all the GUI browsers take into account crappy URL's that LWP and Lynx
don't.
And no, it's not clear that you replaced the url when you quoted the rest
of the error message. "Error, cant get page [url]https://webpage.jsp[/url] -- 302
Moved Temporarily Aborting at ./curu.pl line 77." If you go around
changing what the error messages say, without explicitly saying you did,
why not change the line number too?
For a starter, try ditching simplifying by ditching the ssl part.
A Half assed answer to a half assed question.
- Brian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE/YNcUiK/rA3tCpFYRAuhsAJ9bwRju3+kJj9pjI3wbO35dG/NlJQCfVrKZ
mioQ5Qt69g2NqYq5MvsQtAY=
=HSMu
-----END PGP SIGNATURE-----
Brian Harnish Guest
-
ko #5
Re: not able to access a URL with LWP::UserAgent.
danglesocket <danglesocket@no_spam> wrote in message news:<3f60cda7@shknews01>...
Whoa, don't take things so personally...that's harsh, considering two> Rather than responding with a half assed answer that proves that you didn't
> read the question and
> tries to make me look like an idiot, either don't respond or offer somthing
> more 'insightful'.
things:
1. You're asking for free advice.
2. Really don't see where he was trying to make you look like an idiot
or that a 'half assed answer' was offered. Speaking from *personal*
experience (time wasted looking for something complex when something
simple was breaking my script), its best to *first* look at basic
things when debugging.
Not sure if LWP has some kind of redirection limit (I wouldn't think
that it does), but from the lynx error message you got it seems that
the original URL is being redirected a number of times. LWP::UserAgent
follows redirects automatically. If you deal with the redirects
manually, you can trace what's happening along the way:
====CODE
#!/usr/bin/perl -w
use strict;
use LWP;
my $url = 'your_URL_here';
my $ua = LWP::UserAgent->new(
requests_redirectable => [] # don't follow redirects
);
my @urls = ($url);
while ( @urls ) {
my $r = $ua->head( shift @urls );
if ($r->is_redirect) {
print $r->status_line, "\n"; # server response
print "Redirected: ", $r->header('location'),"\n"; # redirect URL
push @urls, $r->header('location');
}
}
Then you can see the URL of each redirect, and hopefully, where the
problem is occurring.
HTH - keith
ko Guest
-
Tad McClellan #6
Re: not able to access a URL with LWP::UserAgent.
ko <kuujinbo@hotmail.com> wrote:
> danglesocket <danglesocket@no_spam> wrote in message news:<3f60cda7@shknews01>...>>> Rather than responding with a half assed answer that proves that you didn't
>> read the question and
>> tries to make me look like an idiot, either don't respond or offer somthing
>> more 'insightful'.
> Whoa, don't take things so personally
I plonked him when I saw his followup.
--
Tad McClellan SGML consulting
[email]tadmc@augustmail.com[/email] Perl programming
Fort Worth, Texas
Tad McClellan Guest
-
danglesocket #7
Re: not able to access a URL with LWP::UserAgent.
>>> ko<kuujinbo@hotmail.com> 9/11/2003 9:16:58 PM >>>
danglesocket <danglesocket@no_spam> wrote in message
news:<3f60cda7@shknews01>...didn't> Rather than responding with a half assed answer that proves that yousomthing> read the question and
> tries to make me look like an idiot, either don't respond or offerWhoa, don't take things so personally...that's harsh, considering two> more 'insightful'.
things:
1. You're asking for free advice.
2. Really don't see where he was trying to make you look like an idiot
or that a 'half assed answer' was offered. Speaking from *personal*
experience (time wasted looking for something complex when something
simple was breaking my script), its best to *first* look at basic
things when debugging.
-you're right. thanks for the response. apologies to Brian, thanks for the
suggestions.
__danglesocket__
danglesocket Guest



Reply With Quote

