Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- account = AdAccount('act_xxxxxxxxxxxxx')
- ads = account.get_ads(fields=[Ad.Field.id]) //-> using this i get Ad ids
- for id in ads:
- id = id["id"]
- ad = Ad(id)
- ad_preview = ad.get_previews(params={
- 'ad_format': AdPreview.AdFormat.desktop_feed_standard,
- })
- for pre in ad_preview:
- preview = pre["body"]
- preview = str(preview)
- preview = preview.replace("amp;", "")
- preview = (preview.split('src="')[1].split('" width')[0])
- print preview
Add Comment
Please, Sign In to add comment