FND / Scraper.py
Rifky's picture
Update Scraper.py
38b86bb
raw history blame
No virus
497 Bytes
from newspaper import Article
def Scrap(url):
"""
Scrap article from url
### Parameter\n
url : article url (dtype: `string`)\n
summarize : do you want to summarize the article? (dtype: `boolean`)
### Result\n
return the article text (dtype: `string`)
"""
article = Article(url, language='id')
article.download()
article.parse()
if not article.text:
print("Can't Scrap this article link")
return None
return article.text