diff --git a/main.py b/main.py index 6874881..910dfd2 100644 --- a/main.py +++ b/main.py @@ -24,6 +24,11 @@ def secondary_list(path): article_type = soup.find(attrs={"class": ["section_title"]}) if (article_type.find("svg") != None): article_type.find("svg").decompose() + head = article_type.find("span") + if head != None: + head = head.text + else: + head = article_type.text article_type_head = soup.find(attrs={"class": ["img_title_wrap"]}) description = soup.find(attrs={"class": ["desc_cont_wrap"]}).text @@ -52,7 +57,7 @@ def secondary_list(path): next_button = buttons[1] pagenumber = soup.find(attrs={"class": ["pagenumber"]}).text - return [article_type, description, article_list, prev_button, next_button, pagenumber, tags, article_type.text] + return [article_type, description, article_list, prev_button, next_button, pagenumber, tags, head] else: return data.status_code @@ -75,6 +80,11 @@ def article_list(path): # Header article_type = soup.find(attrs={"class": ["section_title"]}) article_type.find("svg").decompose() + head = article_type.find("span") + if head != None: + head = head.text + else: + head = article_type.text article_type_head = soup.find(attrs={"class": ["img_title_wrap"]}) description = soup.find(attrs={"class": ["page_desc_wrapper"]}).text @@ -99,7 +109,7 @@ def article_list(path): next_button = buttons[1] pagenumber = soup.find(attrs={"class": ["pagenumber"]}).text - return [article_type, description, article_list, prev_button, next_button, pagenumber, tags, article_type.text] + return [article_type, description, article_list, prev_button, next_button, pagenumber, tags, head] else: return data.status_code