Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

https and webtechniques #43

by nop (Hermit)
on Mar 09, 2002 at 14:51 UTC ( #150570=perlquestion: print w/replies, xml ) Need Help??
nop has asked for the wisdom of the Perl Monks concerning the following question:

I am using Randal's form ripper script
( )
to pull some data from GoogleAds then extract data from the HTML using HTML::TableExtract.
I am NOT an expert in LWP, but I've used Randal's script successfully elsewhere.
Now I am befuddled.
I think I am running into problems as the page uses HTTPS vs. HTTP.
Here's the error I'm encountering:
C:\Inetpub\wwwroot\google\GoogleTools>perl Can't locate object method "method" via package "HTTP::Headers" (perha +ps you for got to load "HTTP::Headers"?) at C:/Perl/site/lib/HTTP/Mes line 189.
And here's my code:
package GoogleCampaignData; use HTML::TableExtract; use LWP::UserAgent; use HTTP::Request::Common; use strict; sub new { my ($class, $campid) = @_; my $self = {}; _init($self, $campid); bless($self, $class); return $self; } sub _init { my ($self, $campid) = @_; my $ua = LWP::UserAgent->new; $ua->env_proxy; my $req = $ua->request(POST "", [ # "seshid" => "XXXXXX", # hidden "campaign" => $campid, "when" => "campaignlife", # campaign to date "mode" => "keywords", # by keyword URL -- this is critic +al "keywords_criteriaSort" => "parameters", # by keyword "byposition" => "1", # differentiate pos1 and pos2 "display_format" => "html", # HTML results "submit2" => "Generate Report" # do it ], Referer => " +XX&password=XXXX", ); my $content = $ua->request($req)->as_string; die $content; # FOR DEBUGGING -- SHOW WE GOT SOMETHING } 1;

Replies are listed 'Best First'.
Re: https and webtechniques #43
by ellem (Hermit) on Mar 09, 2002 at 23:53 UTC
    I don't mean to be a tool here but the error message says:

    Can't locate object method "method" via package "HTTP::Headers" (perhaps you for got to load "HTTP::Headers"?)

    And I don't see that anywhere. Is it possible that simple?
    There's more than one way to do it, just don't use my way.
Re: https and webtechniques #43
by steves (Curate) on Mar 09, 2002 at 17:05 UTC

    ... and OpenSSL I assume.

    What platform? I've had https problems on Solaris 2.7. From what I've found so far I can't just use the latest triplet of LWP::UserAgent/Crypt::SSLeay/OpenSSL. I've managed to get a set of these three that work okay together, but each one is several versions off the latest. I got various errors when they weren't happy.

    I tried this a few months ago though. Since then, a friend of mine says he has gotten all three latest versions to work together. And from posts I read on the libwww mailing list this was only a problem on Solaris for some reason.

Re: https and webtechniques #43
by drifter (Scribe) on Mar 10, 2002 at 10:30 UTC
    I would try to use Net::SSLeay instead.
    Afaik Crypt::SSLeay has had some difficulties with certain certificates, but I won't confirm theyse rumours.
    Also, while Crypt::SSLeay is basically just a "glue" between OpenSSL and perl, whereas Net::SSLeay is a bit better wrapper.
    Just my 5 cents...
Re: https and webtechniques #43
by nop (Hermit) on Mar 09, 2002 at 15:06 UTC
    PS I have crypt-ssleay installed.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://150570]
Approved by root
[hippo]: That was around April 1994. Fun times.
[hippo]: They had purchased some shiny new 486 DXs the year before but crippled them by installing Win 3.1. I demo'd Linux with X on them to the department head and got the go-ahead to wipe Windows and install the new hotness.
[marto]: glory days ;)

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2018-06-22 09:51 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (124 votes). Check out past polls.