Use more specific exception handling
This commit is contained in:
parent
345c95a477
commit
15b46d2ac1
4
User.py
4
User.py
@ -72,7 +72,7 @@ class User:
|
|||||||
try:
|
try:
|
||||||
next_page_button = soup.select('.submission-list form button[type=submit]')[0]
|
next_page_button = soup.select('.submission-list form button[type=submit]')[0]
|
||||||
next_page_url = FAAPI.FA_BASE_URL + next_page_button.parent().get('action')
|
next_page_url = FAAPI.FA_BASE_URL + next_page_button.parent().get('action')
|
||||||
except:
|
except IndexError:
|
||||||
# No next page, null the url to break the loop
|
# No next page, null the url to break the loop
|
||||||
next_page_url = None
|
next_page_url = None
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ class User:
|
|||||||
try:
|
try:
|
||||||
next_page_button = soup.select('.pagination a.button:last-child')[0]
|
next_page_button = soup.select('.pagination a.button:last-child')[0]
|
||||||
next_page_url = FAAPI.FA_BASE_URL + next_page_button.get('href')
|
next_page_url = FAAPI.FA_BASE_URL + next_page_button.get('href')
|
||||||
except:
|
except IndexError:
|
||||||
# No next page, null the url to break the loop
|
# No next page, null the url to break the loop
|
||||||
next_page_url = None
|
next_page_url = None
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user