From 192ca21118b0903f699c4a02a14a36ac0d2b740f Mon Sep 17 00:00:00 2001 From: theslavicbear <44584508+theslavicbear@users.noreply.github.com> Date: Thu, 7 Dec 2023 08:51:02 -0500 Subject: [PATCH] Add files via upload --- Site/Chyoa.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Site/Chyoa.py b/Site/Chyoa.py index c983bbb..301b454 100755 --- a/Site/Chyoa.py +++ b/Site/Chyoa.py @@ -64,15 +64,19 @@ def __init__(self, url): return None soup=BeautifulSoup(page.content, 'html.parser') - self.title=soup.find('h3').get_text() - if self.title=='Log In': - try: - self.title=soup.find('h1').get_text() - self.backwards = False - except: - pass - elif not self.backwards: - self.partial = True + if soup.find('h3') is None: + self.title=soup.find('h1').get_text() + self.backwards=False + else: + self.title=soup.find('h3').get_text() + if self.title=='Log In': + try: + self.title=soup.find('h1').get_text() + self.backwards = False + except: + pass + elif not self.backwards: + self.partial = True #get update timestamp: