diff --git a/tests/test_download.py b/tests/test_download.py index 5b6e4e7..929478c 100644 --- a/tests/test_download.py +++ b/tests/test_download.py @@ -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(): diff --git a/url2markdown/downloader.py b/url2markdown/downloader.py new file mode 100644 index 0000000..deb793d --- /dev/null +++ b/url2markdown/downloader.py @@ -0,0 +1,7 @@ +from newspaper import Article + + +def downloader(url): + article = Article(url) + article.download() + return article