Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 14:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found