GoogleNews icon indicating copy to clipboard operation
GoogleNews copied to clipboard

two bugs for new update

Open alinemati-uwm opened this issue 1 year ago • 11 comments

thanks for update, I can see two bugs there:

I search for chatgot to check

URL looks extra stuff which does not open the link 'desc': '' is empty Mycode: from GoogleNews import GoogleNews googlenews = GoogleNews() googlenews.enableException(True) googlenews.set_lang('en') googlenews.set_period('1d') googlenews.set_time_range('08/11/2023','02/28/2020') googlenews.set_encode('utf-8') googlenews.search('Chatgpt') result = googlenews.page_at(2) result

My result: [{'title': 'Hackers take on ChatGPT with support from White House', 'media': 'CNN', 'date': '6 hours ago', 'datetime': datetime.datetime(2023, 8, 11, 20, 8, 33, 681797), 'desc': '', 'link': '/url?esrc=s&q=&rct=j&sa=U&url=https://www.cnn.com/videos/world/2023/08/11/exp-hackers-ai-vegas-lkl-081102pseg2-cnni-world.cnn&ved=2ahUKEwi11JzzhNaAAxUxm1YBHTz2Dx04ChDF9AF6BAgDEAI&usg=AOvVaw14nsFJTPwZeSPlNUzqrOE5', 'img': 'data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='},

alinemati-uwm avatar Aug 12 '23 02:08 alinemati-uwm

I fixed it by myself

alinemati-uwm avatar Aug 12 '23 18:08 alinemati-uwm

Hi @alinemati-uwm,

Would you please provide the solution to the empty "desc" problem? I encountered the bug too but I can't figure out the solution

Gary-HO avatar Aug 14 '23 03:08 Gary-HO

Hi all, I also found out this issue which the URL contains extra stuff so that the content can't be downloaded properly. Is there any solution ?

tin8420 avatar Aug 14 '23 09:08 tin8420

BTW I already trimmed the URL to proper format which start with htttps but also not working.

tin8420 avatar Aug 14 '23 09:08 tin8420

I extracted whole code and updated. please use below link if you want to use it

colab

alinemati-uwm avatar Aug 14 '23 18:08 alinemati-uwm

Hi @alinemati-uwm, I was wondering if you have update version for 1.6.10 because URL in this version still contains extra stuff so that article couldn't be downloaded successfully

tin8420 avatar Sep 18 '23 08:09 tin8420

Hi @alinemati-uwm, I was wondering if you have update version for 1.6.10 because URL in this version still contains extra stuff so that article couldn't be downloaded successfully

No sure what do you need but the result is json file which you can extract whatever you want.

alinemati-uwm avatar Sep 18 '23 14:09 alinemati-uwm

Thanks, may I ask which version are you using now? because the latest version is 1.6.10 and the last time you provide modified code is version 1.6.9

tin8420 avatar Sep 19 '23 08:09 tin8420

I updated the python script on the colab. you can use it and run locally. it works. colab's linke is above-mentioned.

alinemati-uwm avatar Sep 19 '23 18:09 alinemati-uwm

@alinemati-uwm Thanks a lot, I try your code but it failed. would you check if you modified in the latest version(1.6.10)? image

tin8420 avatar Sep 20 '23 02:09 tin8420

Hi @alinemati-uwm, I run colab, but it returns []. Can you help me?

prigioni avatar Oct 16 '23 02:10 prigioni