GoogleNews
GoogleNews copied to clipboard
two bugs for new update
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=='},
I fixed it by myself
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
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 ?
BTW I already trimmed the URL to proper format which start with htttps but also not working.
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
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.
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
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 Thanks a lot, I try your code but it failed. would you check if you modified in the latest version(1.6.10)?
Hi @alinemati-uwm, I run colab, but it returns []. Can you help me?