![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
爬虫
iplaypy(蟒蛇师)
认真亦信仰
展开
-
爬取百度贴吧
import urllib.requestimport urllib.parseimport os,time#输入贴吧名字baname = input("请输入贴吧的名字:")start_page = int(input("请输入起始页"))end_page = int(input("请输入结束页"))#不完整的urlurl = "https://tieba.baidu.com/f...原创 2019-03-22 19:58:13 · 230 阅读 · 0 评论 -
Python爬虫大招之selenium有无界面
selenium是什么?他是一个浏览器的自动化测试工具,就是你写一些代码,代码取操作浏览器执行一些功能 `安装selenium pip install seleniumselenium操作了谷歌的一个驱动谷歌浏览器驱动下载地址:http://chromedriver.storage.googleapis.com/index.htmlhttp://npm.taobao.or...原创 2019-08-18 10:23:21 · 172 阅读 · 0 评论 -
python爬京东商品评论(json)
# __author: han-zhang# date: 2019/8/16 18:02import urllib.requestimport json, jsonpathstart_page = int(input('start_page:'))end_page = int(input('end_page:'))for p in range(start_page, end_...原创 2019-08-16 22:40:51 · 1891 阅读 · 0 评论 -
python爬豆瓣影评(json+lxml+urllib)
#__author: han-zhang#date: 2019/8/16 15:30from lxml import etreeimport urllib.requestimport json#urlurl='https://movie.douban.com/j/chart/top_list?type=17&interval_id=100%3A90&actio...原创 2019-08-16 16:46:27 · 191 阅读 · 0 评论 -
爬取高清站长之家美图(想爬多少爬多少)
# __author: han-zhang# date: 2019/8/16 11:39from lxml import etreeimport urllib.requestimport os, timeclass OuMeiSpider(object): def __init__(self, start_page, end_page): self.st...原创 2019-08-16 16:42:10 · 323 阅读 · 0 评论 -
python爬51job招聘网站信息(requests+bs4)
# __author: han-zhang# date: 2019/8/15 17:15from bs4 import BeautifulSoupimport urllib.request, timedef get_request(url): headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; ...原创 2019-08-15 22:54:56 · 335 阅读 · 0 评论 -
python爬诗词名句网站三国图书内容(requests+bs4)
# __author: han-zhang# date: 2019/8/15 16:15from bs4 import BeautifulSoupimport urllib.requestimport timedef get_request(url): headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT ...原创 2019-08-15 22:53:43 · 239 阅读 · 0 评论 -
python爬虫美拍网视频
# __author: han-zhang# date: 2019/8/19 12:53# url https://www.meipai.com# 第一步拿到href="/media/1132146237# 拼接url https://www.meipai.com/media/1132146237# 第二步,找到视频真实链接src ...原创 2019-08-20 23:58:52 · 791 阅读 · 0 评论 -
python爬虫之多线程模板(例:泛见志)
# __author: han-zhang# date: 2019/8/19 16:13# page_queue、data_queue、多线程from queue import Queueimport threadingimport requestsfrom bs4 import BeautifulSoupimport time,re,jsonclass CrawlT...原创 2019-08-20 09:48:09 · 370 阅读 · 1 评论 -
python爬虫全国各大城市公交线路及各种信息
# __author: han-zhang# date: 2019/8/18 15:59import requestsimport time, re, jsonfrom bs4 import BeautifulSoupheaders = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWeb...原创 2019-08-19 00:44:02 · 1131 阅读 · 2 评论 -
爬虫 云盘资料搜索
import urllib.requestimport urllib.parseimport os,time#输入贴吧名字baname = input("请输入贴吧的名字:")start_page = int(input("请输入起始页"))end_page = int(input("请输入结束页"))#不完整的urlurl = "https://tieba.baidu.com/f...原创 2019-03-22 19:59:08 · 740 阅读 · 0 评论 -
爬虫是在搞什么
爬虫:写一段代码,去指定的URL(网站)去获取指定的数据互联网:互联网中给你一个起始URL,www.baidu.com ,互联网中的每一个节点都是一个a链接,或者称为URL通用爬虫:百度,搜狗,google,雅虎,bing1、工作:1、爬取所有信息2、主动提交url(提升排名)3、百度主动和域名服务商合作2、 robots.txt(君子协议)此协议可以告诉百度那些网页可以爬取那些不...原创 2019-08-27 15:19:24 · 685 阅读 · 0 评论