Я использую модуль Python newspaper3k
и извлекаю резюме статьи, используя его веб-URL.Как,
from newspaper import Article
article = Article('https://www.abcd....vnn.com/dhdhd')
article.download()
article.parse()
article.nlp()
text = article.summary
print (text)
Дает,
Often hailed as Hollywood\xe2\x80\x99s long standing, commercially successful filmmaker, Spielberg\xe2\x80\x99s lifetime gross, if you include his productions, reaches a mammoth\xc2\xa0$17.2 billion\xc2\xa0\xc2\xad\xe2\x80\x93 unadjusted for inflation.
\r\rThe original\xc2\xa0Jurassic Park\xc2\xa0($983.8 million worldwide), which released in 1993, remains Spielberg\xe2\x80\x99s highest grossing film.
Ready Player One,\xc2\xa0currently advancing at a running total of $476.1 million, has become Spielberg\xe2\x80\x99s seventh highest grossing film of his career.It will eventually supplant Aamir\xe2\x80\x99s 2017 blockbuster\xc2\xa0Dangal\xc2\xa0(1.29 billion yuan) if it achieves the Maoyan\xe2\x80\x99s lifetime forecast of 1.31 billion yuan ($208 million) in the PRC.
Все, что я хочу удалить все нежелательные символы, такие как \xe2\x80\x99s
.Я избегаю использовать несколько replace
функций.Все, что я хочу что-то вроде: -
Often hailed as Hollywood long standing, commercially successful filmmaker,
Spielberg lifetime gross, if you include his productions, reaches a
mammoth $17.2 billion unadjusted for inflation.
The original Jurassic Park ($983.8 million worldwide),
which released in 1993, remains Spielberg highest grossing film.
Ready Player One,currently advancing at a running total of $476.1 million,
has become Spielberg seventh highest grossing film of his career.
It will eventually supplant Aamir 2017 blockbuster Dangal (1.29 billion yuan)
if it achieves the Maoyan lifetime forecast of 1.31 billion yuan ($208 million) in the PRC