Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __check_rows(self):
"""
Checks if the user input for row number is correct.
Otherwise, modifies the number or raises NoResults error.
"""
self._total_rows = scrape.get_total_rows(self._page_content)
if self._total_rows == 0:
raise NoResults(self._url.split('?')[1])
elif self._rows is None or self._rows > self._total_rows:
return self._total_rows
else:
return self._rows