diff options
Diffstat (limited to 'article_epub/utilities.py')
-rw-r--r-- | article_epub/utilities.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/article_epub/utilities.py b/article_epub/utilities.py index 1fa1f61..60a2d97 100644 --- a/article_epub/utilities.py +++ b/article_epub/utilities.py @@ -14,11 +14,16 @@ def url_from_title(title): .find('div',class_='gs_ri').find('a') possible_title = result.text possible_link = result['href'] + + if possible_title == '': + print('No matching link available.') + sys.exit('Getting URL from title failed') + print('Provided title:') print(title) print('Found following article:') print(possible_title) - choice = input("Is this correct (y/n)? ") + choice = input("\033[0;37m"+"Is this correct (y/n)? "+"\033[00m") if choice == 'y': return(possible_link) else: |