摘要: 在顶部引多一个包即可 from requests.packages.urllib3.exceptions import InsecureRequestWarning,InsecurePlatformWarningrequests.packages.urllib3.disable_warnings(I 阅读全文
posted @ 2018-11-08 19:43 凯宾斯基 阅读(1001) 评论(0) 推荐(0)
摘要: soup = BeautifulSoup(requests.get(url).text, 'html.parser') soup.find('span', class_='item_hot_topic_title') 这个是只能找到第一个span标签 样式为 class='item_hot_topi 阅读全文
posted @ 2018-11-08 16:11 凯宾斯基 阅读(3328) 评论(0) 推荐(0)
摘要: 案例一: #coding=utf-8import jsonimport requestsfrom bs4 import BeautifulSoupurl = 'http://www.itest.info/courses' # 定义被抓取页面的urlsoup = BeautifulSoup(reque 阅读全文
posted @ 2018-11-08 09:36 凯宾斯基 阅读(18443) 评论(0) 推荐(1)