add a method to download an article

This commit is contained in:
Andreas Zweili 2020-10-12 14:49:46 +02:00
parent 529c9a6fba
commit 49d0407397
2 changed files with 12 additions and 2 deletions

View File

@ -1,7 +1,10 @@
import url2markdown
from newspaper import Article
from url2markdown.downloader import downloader
def test_get_content():
assert False
article = downloader('https://newspaper.readthedocs.io/en/latest/user_guide/quickstart.html')
assert type(article) == Article
def test_convert_html_to_markdown():

View File

@ -0,0 +1,7 @@
from newspaper import Article
def downloader(url):
article = Article(url)
article.download()
return article