Переглянути джерело

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 = {