Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created April 21, 2020 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BMU-Verlag/3c8b01303b4eb0a2f0eff8a2738e1069 to your computer and use it in GitHub Desktop.
Save BMU-Verlag/3c8b01303b4eb0a2f0eff8a2738e1069 to your computer and use it in GitHub Desktop.
def validate_articles(articles):
valid_articles = []
for article in articles:
if ('url' not in article or 'target_price' not in article):
continue
if ('amzn.to' not in article['url'] or type(article['target_price'])
is not float):
continue
valid_articles.append(article)
return valid_articles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment