AdWords - 使用Python

时间:2015-05-01 01:59:31

标签: python python-2.7 google-adwords

我需要获取一个示例Python脚本,该脚本连接到Google AdWords并下载广告系列报告。我已经看到了大量的代码,但我需要完整的脚本。到目前为止我所做的是以下内容,但是当我使用GetReportDownloader时,我收到以下错误:' AdWordsClient'对象没有属性' GetReportDownloader'

 import os
import datetime
from adspygoogle.adwords.AdWordsClient import AdWordsClient
from adspygoogle.common import Utils
from pprint import pprint

google_service = 'https://adwords.google.com'
headers = {
      'email': 'me@gmail.com',
      'password': '*******',
      'userAgent': 'Arash MCC',
      'developerToken': '45345gfdg435dfgdfg',
    }


google_service = 'https://adwords.google.com'
api_version = 'v201101'

client = AdWordsClient(headers=headers)
client.use_mcc = True
client.SetDebug=True
client.SetClientCustomerId='123-456-7890'
campaign_service = client.GetCampaignService(google_service, api_version)

#report_downloader = client.GetReportDownloader(version=api_version)
report_downloader = client.GetReportDownloader('https://adwords.google.com', api_version)

0 个答案:

没有答案