摘要:
from urllib import request from bs4 import BeautifulSoup as bs #爬取豆瓣最受关注图书榜 resp = request.urlopen('https://book.douban.com/chart?subcat=I') html_data = resp.read().decode('utf-8') #转化为BeautifulSou... 阅读全文
摘要:
from urllib import request from bs4 import BeautifulSoup as bs #爬取豆瓣最受关注图书榜 resp = request.urlopen('https://book.douban.com/chart?subcat=I') html_data = resp.read().decode('utf-8') #转化为BeautifulSou... 阅读全文
摘要:
import requests #requests模块用于HTTP请求 import codecs #codecs模块用于文件操作 from bs4 import BeautifulSoup #beautifulSoup库用于对html代码进行解析 #要爬取的地址 URL="https://book.douban.com/top250" #user-agent,模仿浏览器,防止被目... 阅读全文