def main(client, campaign_id):
# Initialize appropriate service.ad_group_service = client.GetService('AdGroupCriterionService', version='v201809')
offset = 0
# Construct selector and get all ad groups.
selector = {
'fields': [
'AdGroupId','BaseCampaignId','QualityScore'
,'BiddingStrategyId','BiddingStrategyName','BiddingStrategySource','BiddingStrategyType'
],
'predicates': [
{
'field': 'CampaignId',
'operator': 'EQUALS',
'values': [campaign_id]
}
],
'paging': {
'startIndex': str(offset),
'numberResults': str(PAGE_SIZE)
}
}
more_pages = True
while more_pages:
page = ad_group_service.get(selector)
# Display results.
if 'entries' in page:
for ad_group in page['entries']:
print(ad_group)
else:
print ('No ad groups were found.')
offset += PAGE_SIZE
selector['paging']['startIndex'] = str(offset)
more_pages = offset < int(page['totalNumEntries'])
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, CAMPAIGN_ID)

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/uzsF0_nV1IE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/528ff8f4-d455-4259-985d-cf33ee38f0dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.