import requests
import re
from bs4 import BeautifulSoup


def nextPageLink(sess,soup,page,head=""):
    NextPage=soup.find(class_='next').link.get('href')
    req=sess.get(head + NextPage)
    print(f'第{page}页：',req.status_code)
    return BeautifulSoup(req.text,'html.parser')
[((10, 11, 10, 48), 'bs4.BeautifulSoup', 'BeautifulSoup', ({(10, 25, 10, 33): 'req.text', (10, 34, 10, 47): '"""html.parser"""'}, {}), "(req.text, 'html.parser')", False, 'from bs4 import BeautifulSoup\n')]