Skip to content

Instantly share code, notes, and snippets.

@JohnDeJesus22
Created June 3, 2020 01:53
Show Gist options
  • Save JohnDeJesus22/63a8b88344be7f3cda1a3a46c9769c44 to your computer and use it in GitHub Desktop.
Save JohnDeJesus22/63a8b88344be7f3cda1a3a46c9769c44 to your computer and use it in GitHub Desktop.
article_download_newspaper_library
# set configuration to not capture images
config = Config()
config.fetch_images = False
# applying article function from newspaper to each link and creating list
articles = [Article(url) for url in search_results]
# download the articles
articles_downloaded = [article.download() for article in articles]
# download the articles
articles_parsed = [article.parse() for article in articles]
# get text from articles
article_text = [article.text for article in articles]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment