Hi Stephen,
Seems your issue are more related to the implementation of Python client
library rather than the AdWords API. I would suggest to post your concern
here <https://github.com/googleads/googleads-python-lib/issues> as the
Python client library owners are better equipped to assist you here.
Thanks and regards,
Luis
AdWords API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
On 01/25/19 08:19:38 steponaf...@gmail.com wrote:
Hi!
I'm running on Python and I am having a little bit of trouble with the
display results portion of the script. Instead of printing the results, I
wanted to save the keyword and search volume into a list to use elsewhere.
I am trying to just store the variables and I'm getting this error:
sv *undefined*, *attributes* = {'KEYWORD_TEXT': 'seo'}
*KeyError*: 'SEARCH_VOLUME'
args = ('SEARCH_VOLUME',)
with_traceback = <built-in method with_traceback of KeyError object>
Here is the portion of the script:
# Display results.
if 'entries' in page:
keyword_list = []
for result in page['entries']:
attributes = {}
for attribute in result['data']:
print(attribute)
attributes[attribute['key']] = getattr(attribute['value'], 'value'
, '0')
kw = attributes['KEYWORD_TEXT']
sv = attributes['SEARCH_VOLUME']
#print ('Keyword with "%s" text and average monthly search volume '
# '"%s".'
# % (attributes['KEYWORD_TEXT'], attributes['SEARCH_VOLUME']))
print(kw)
else:
print ('No related keywords were found.')
When I don't try and save them as variables, or into a list, and just print
them, it works.
Please advise?
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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 the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to adwords-api+unsubscr...@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/deba3d84-f85c-4461-9e29-f5cf62f275d5%40googlegroups.com
<https://groups.google.com/d/msgid/adwords-api/deba3d84-f85c-4461-9e29-f5cf62f275d5%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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 the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to adwords-api+unsubscr...@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/00d12ftqd800000006cinq005p2drmz64mj0e9o6go30c1g68q3ichg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.