我是编程新手,一直在通过网络抓取学习Python。我想要做的是从我的 URL 中列出的站点捕获以下行:<a class="" href="https://www.adweek.com?paged=776%3Fs%3Dinterpublic&orderby=date&s=interpublic">776</a>,但我似乎无法到达那里。它只返回第一行分页信息,我不明白为什么。任何帮助将不胜感激import requestsfrom bs4 import BeautifulSoupurl = 'https://www.adweek.com/?s=interpublic&orderby=date'req = requests.get(url)soup = BeautifulSoup(req.content, 'html.parser')k =soup.find_all('div', {'class':'pagination-centered'})只退货——[<div class="pagination-centered"><ul class="pagination"> <li><span aria-current="page" class="current">1</span></li></ul></div>]
添加回答
举报
0/150
提交
取消