Finding number of pages using Python BeautifulSoup
问题 I want to extract the total page number (11 in this case) from a steam page. I believe that the following code should work (return 11), but it is returning an empty list. Like if it is not finding paged_items_paging_pagelink class. import requests import re from bs4 import BeautifulSoup r = requests.get('http://store.steampowered.com/tags/en-us/RPG/') c = r.content soup = BeautifulSoup(c, 'html.parser') total_pages = soup.find_all("span",{"class":"paged_items_paging_pagelink"})[-1].text 回答1: