ソースを参照

Merge branch 'wengao' of ASJ_ADS/sync_amz_data into master

wengao 1 年間 前
コミット
e368e587cb
1 ファイル変更13 行追加0 行削除
  1. 13 0
      sync_amz_data/public/amz_ad_client.py

+ 13 - 0
sync_amz_data/public/amz_ad_client.py

@@ -293,6 +293,19 @@ class SPClient(BaseClient):
                 }
         return self._request(url_path,method="POST",body=body)
 
+    def iter_bidrecommendationList(self, adGroupId, expressions):
+        for i in range(0,len(expressions), 10):
+            try:
+                info = self.get_bidrecommendationList(adGroupId, expressions[i:i+10])
+                out = info['recommendations']
+                for i in out:
+                    i['adGroupId'] = adGroupId
+                yield from out
+            except:
+                # print("空值")
+                return iter([])
+
+
     def get_campaignNegativekeyword(self,**body):
         url_path = '/sp/campaignNegativeKeywords/list'
         headers = {