Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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
(http://www.stonehenge.com/merlyn/WebTechniques/col43.html )
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 gt_refresh.pl 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 +sage.pm 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 "https://adwords.google.com/reports/ads", [ # "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 => "http://ads.google.com/reports/ads?username=XX +XX&password=XXXX", ); my $content = $ua->request($req)->as_string; die $content; # FOR DEBUGGING -- SHOW WE GOT SOMETHING } 1;
nop

Comment on https and webtechniques #43
Select or Download Code
Re: https and webtechniques #43
by nop (Hermit) on Mar 09, 2002 at 15:06 UTC
    PS I have crypt-ssleay installed.
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 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?
    --
    ellem@optonline.net
    There's more than one way to do it, just don't use my way.
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...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://150570]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2015-07-05 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls