ranahaani / GNews

A Happy and lightweight Python Package that Provides an API to search for articles on Google News and returns a JSON response.
https://pypi.org/project/gnews/
MIT License
706 stars 107 forks source link

Newspaper pip install running each time i run the script #57

Open maverick62 opened 1 year ago

maverick62 commented 1 year ago

I just started to use your library but i have a problem with full article

from gnews import GNews
google_news = GNews(language='fr', country='FR', period='1d',max_results=2)
pakistan_news = google_news.get_news_by_topic('TECHNOLOGY')

for x in pakistan_news:
    article = google_news.get_full_article(pakistan_news[0]['url'])
    print(x)
    print(article.text )

by just adding the line 'article = google_news.get_full_article(pakistan_news[0]['url'])' the console is showing a pip install output. and this, each time the 'for loop' is running.

what can i do ?

thanks

eg of output :

python news.py WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. Requirement already satisfied: newspaper3k in c:\python311\lib\site-packages (0.2.8) Requirement already satisfied: beautifulsoup4>=4.4.1 in c:\python311\lib\site-packages (from newspaper3k) (4.9.3) Requirement already satisfied: Pillow>=3.3.0 in c:\python311\lib\site-packages (from newspaper3k) (9.4.0) Requirement already satisfied: PyYAML>=3.11 in c:\python311\lib\site-packages (from newspaper3k) (6.0) Requirement already satisfied: cssselect>=0.9.2 in c:\python311\lib\site-packages (from newspaper3k) (1.2.0) Requirement already satisfied: lxml>=3.6.0 in c:\python311\lib\site-packages (from newspaper3k) (4.9.2) Requirement already satisfied: nltk>=3.2.1 in c:\python311\lib\site-packages (from newspaper3k) (3.8.1) Requirement already satisfied: requests>=2.10.0 in c:\python311\lib\site-packages (from newspaper3k) (2.26.0) Requirement already satisfied: feedparser>=5.2.1 in c:\python311\lib\site-packages (from newspaper3k) (6.0.10) Requirement already satisfied: tldextract>=2.0.1 in c:\python311\lib\site-packages (from newspaper3k) (3.4.0) Requirement already satisfied: feedfinder2>=0.0.4 in c:\python311\lib\site-packages (from newspaper3k) (0.0.4) Requirement already satisfied: jieba3k>=0.35.1 in c:\python311\lib\site-packages (from newspaper3k) (0.35.1) Requirement already satisfied: python-dateutil>=2.5.3 in c:\python311\lib\site-packages (from newspaper3k) (2.8.2) Requirement already satisfied: tinysegmenter==0.3 in c:\python311\lib\site-packages (from newspaper3k) (0.3) Requirement already satisfied: soupsieve>1.2 in c:\python311\lib\site-packages (from beautifulsoup4>=4.4.1->newspaper3k) (2.4) Requirement already satisfied: six in c:\python311\lib\site-packages (from feedfinder2>=0.0.4->newspaper3k) (1.12.0) Requirement already satisfied: sgmllib3k in c:\python311\lib\site-packages (from feedparser>=5.2.1->newspaper3k) (1.0.0) Requirement already satisfied: click in c:\python311\lib\site-packages (from nltk>=3.2.1->newspaper3k) (8.1.3) Requirement already satisfied: joblib in c:\python311\lib\site-packages (from nltk>=3.2.1->newspaper3k) (1.2.0) Requirement already satisfied: regex>=2021.8.3 in c:\python311\lib\site-packages (from nltk>=3.2.1->newspaper3k) (2023.3.23) Requirement already satisfied: tqdm in c:\python311\lib\site-packages (from nltk>=3.2.1->newspaper3k) (4.64.1) Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\python311\lib\site-packages (from requests>=2.10.0->newspaper3k) (1.26.14) Requirement already satisfied: certifi>=2017.4.17 in c:\python311\lib\site-packages (from requests>=2.10.0->newspaper3k) (2022.12.7) Requirement already satisfied: charset-normalizer~=2.0.0 in c:\python311\lib\site-packages (from requests>=2.10.0->newspaper3k) (2.0.12) Requirement already satisfied: idna<4,>=2.5 in c:\python311\lib\site-packages (from requests>=2.10.0->newspaper3k) (3.4) Requirement already satisfied: requests-file>=1.4 in c:\python311\lib\site-packages (from tldextract>=2.0.1->newspaper3k) (1.5.1) Requirement already satisfied: filelock>=3.0.8 in c:\python311\lib\site-packages (from tldextract>=2.0.1->newspaper3k) (3.11.0) Requirement already satisfied: colorama in c:\python311\lib\site-packages (from click->nltk>=3.2.1->newspaper3k) (0.4.6) {'title': "L'Allemagne dit adieu à ses dernières centrales nucléaires - Le Monde", 'description': "L'Allemagne dit adieu à ses dernières

zain-mush commented 1 year ago

in line 185 of gnews.py, in the get_full_article defenition, there is a check to see if you have newspaper3k installed, however, newspaper3k is misspelled as newspaper.