Re: Perl - approach to query https website for code & parsing xml response



deep <deepalicanada@xxxxxxxxx> writes:

I tried that but got same results. I used following:

my $ua = new LWP::UserAgent;
my $res = $ua->post ($url);
print $res->as_string;
print "\nResult - $res->content";
print "\n Error - $res->status_line";

Here's my attempt against a live site (sourceforge), it works:

alteran:~ zakame$ perl -de 0 -MLWP::UserAgent

Loading DB routines from perl5db.pl version 1.28
Editor support available.

,----[ perl -de 0 -MLWP::UserAgent ]
| Enter h or `h h' for help, or `man perldebug' for more help.
|
| main::(-e:1): 0
| DB<1> $ua = LWP::UserAgent->new()
|
| DB<2> $url = 'https://sourceforge.net/forum/forum.php'
|
| DB<3> $res = $ua->post( $url, forum_id => '849067' )
|
| DB<4> x $res->as_string()
| 0 "HTTP/1.1 200 OK\cJConnection: close..."
|
| DB<5> x $res->status_line()
| 0 '200 OK'
`----

--
I like the idea of 256 bits, though: 32 for the (Unicode) character leaves
room for 224 Bucky bits, which ought to be enough for anyone.
-- Roland Hutchinson, in alt.folklore.computers
.



Relevant Pages

  • Re: Error trapping
    ... > All errors relating to the loading and displaying of the form ... > that occour in routines of controls on the form like ... Generally when you load a form, the program that does the loading ...
    (microsoft.public.vb.general.discussion)
  • Re: Error trapping
    ... >> All errors relating to the loading and displaying of the form ... >> that occour in routines of controls on the form like ... >Generally when you load a form, the program that does the loading ...
    (microsoft.public.vb.general.discussion)
  • Re: perl segfault - how to troubleshoot
    ... gdb `which perl` -c mythrename.pl ... Loading DB routines from perl5db.pl version 1.28 ...
    (comp.lang.perl.misc)
  • Reading ENVI Images
    ... Does anyone have code I could use to read an ENVI image into matlab ... based on its header info? ... I have several different routines for ... loading specific things, but do not have a general utility. ...
    (comp.soft-sys.matlab)