Skip to content

Commit

Permalink
fixed get_news() title with media issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HurinHu committed Feb 10, 2024
1 parent 6d91fdb commit f168c2f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions GoogleNews/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self,lang="en",period="",start="",end="",encode="utf-8",region=None
self.__end = end
self.__encode = encode
self.__exception = False
self.__version = '1.6.12'
self.__version = '1.6.13'

def getVersion(self):
return self.__version
Expand Down Expand Up @@ -284,7 +284,7 @@ def get_news(self, key="",deamplify=False):
try:
# title
try:
title=article.findAll('div')[2].text
title=article.findAll('div')[2].findAll('a')[0].text
except:
title=None
# description
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="GoogleNews",
version="1.6.12",
version="1.6.13",
author="Hurin Hu",
author_email="[email protected]",
description="Google News search for Python",
Expand Down
2 changes: 1 addition & 1 deletion test/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TestStringMethods(unittest.TestCase):

def testVersion(self):
googlenews = GoogleNews()
version = '1.6.12'
version = '1.6.13'
self.assertIn(version, googlenews.getVersion())
print('Latest version matched')

Expand Down

0 comments on commit f168c2f

Please sign in to comment.