def google_search(key_word):
service = build("customsearch", "v1",
developerKey="??KEY")
res = service.cse().list(
q=key_word,
cx='????ID',
num=10, #Valid values are integers between 1 and 10, inclusive.
).execute()
for value in res:
#print(value)
if 'items' in value:
for results in res[value]:
#print(results)
print(results['formattedUrl'])
评论列表
文章目录