Web Scraping:通过 Python 抓取多个网页

from bs4 import BeautifulSoup

import requests


url = 'https://uk.trustpilot.com/review/thread.com'

for pg in range(1, 10):

  pg = url + '?page=' + str(pg)

  soup = BeautifulSoup(page.content, 'lxml')

  for paragraph in soup.find_all('p'):

     print(paragraph.text)

我想从https://uk.trustpilot.com/review/thread.com 中抓取排名、审查和审查日期,但是,我不知道如何从多个页面中抓取并为抓取结果


catspeake
浏览 199回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python