page_count_links = soup.find_all('a', href=re.compile(
    '.*javascript:goToPage.*'))
try:
    num_pages = int(page_count_links[-1].get_text())
except IndexError:
    num_pages = 1
url_list = ['{}&pageNum={}'.format(base_url, str(page)) for page in range(1,
    num_pages + 1)]
for url_ in url_list:
    print('Processing {}...'.format(url_))
r_new = rq.get(url_)
soup_new = bsoup(r_new.text)
for tr in soup_new.find_all('tr', align='center'):
    stack = []
for td in tr.findAll('td'):
    stack.append(td.text.replace('\n', '').replace('\t', '').strip())
acct.write(', '.join(stack) + '\n')
Scrape multiple pages with BeautifulSoup and Python