I tried to retrieve my report from google adwords without entering username/password manually. Once I am in, I need to grab the content such as total cost and click. Here's my code so far:

<body onLoad="javascript:document.ff.submit()">
<form action="https://adwords.google.com/select/main#a" method="post name="ff">
<input type="hidden" name="cmd" value="LoginValidation">
<input type="hidden" name="hl" value="en_US">
<input type="hidden" name="login.userid" value="test@abc.com">
<input type="hidden" name="login.password" value="myPassword">
<input type="hidden" name="login">
</form>

</body>
<?
$url = "https://adwords.google.com/select/CampaignSummary";

sleep(120);
if ($fp = @fopen($url, "r")) {
while (!feof($fp)) $data .= fgets($fp, 128);
fclose($fp);
}

echo $data;

?>

So far, I am able to auto login - but I can't grab the data. Please help. Thanks.

Best Regards,
A.g

    Hi,

    nine times out of ten you wont be able to do that as i'm sure some type of server side session variables are needed to access that information or at least for some type of authentication.

    Which you would not be able to create on your end.

    troinfo

      method="post name="ff">

      should be
      method="post" name="ff">

      You are missing a Submit button type.

        Write a Reply...