# -*- coding: UTF-8 -*-
# 爬虫
from bs4 import BeautifulSoup
bsObj = BeautifulSoup(response, 'html.parser')
# 数组id匹配内容
idList = [**,**]
# 数组information存储数据
information = [[*******,********],[]]
for n in range(len(idList)):
# 爬取符合要求的span
info = bsObj.find_all('span', {'id': idList[n]})[0].text
information[1].append(info)
print information[0][n],':' ,information[1][n]
操作 Python爬虫数据存储MySQL【3】爬取信息
最新推荐文章于 2021-03-05 16:45:32 发布