使用工具:Python3; PyCharm
需要模块: requests, BeautifulSoup4
- 实现在goodreads上爬所有的Stephen King的quotes#可以根据需要在其他网站爬其他信息
代码片如下
import requests
from bs4 import BeautifulSoup
#requests can be installed by pip through cmd
#BeautifulSoup4 can be installed by File-Settings-Project Interpreter, search and add BeautifulSoup4
'''
This is a simple web crawler that crawls quotes by Stephen King on Goodreads.com
'''
def stephen_king_quote(max_pages):
page