Created
May 27, 2019 10:06
-
-
Save manuel-delverme/9e32ce36efc2c31f0232a8fbfff4a7d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import newspaper | |
article = newspaper.Article("http://www.ansa.it/sito/notizie/tecnologia/hitech/2015/04/06/robot-per-amazon-due-italiani-in-gara_e1199b8c-95e0-4700-8283-8a6b0a882a6c.html") | |
article.download() | |
article.parse() | |
article.nlp() | |
html = f""" | |
<table border=1> | |
<tr> | |
<td>testo</td> | |
<td>{article.text}</td> | |
</tr> | |
<tr> | |
<td>son mario</td> | |
<td>article.summary</td> | |
</tr> | |
<tr> | |
<td>gg</td> | |
<td>easy</td> | |
</tr> | |
</table> | |
""" | |
with open('out.html', 'w') as fout: | |
fout.write(html) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment