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

In reply to https and webtechniques #43 by nop

Title:
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, details, 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, summary, 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.