摘要:
# 中国天气网 # 练习使用 BeautifulSoup 解析 # 数据可视化 import requests from bs4 import BeautifulSoup import html5lib from pyecharts import Bar ALL_DATA = [] def parse_page(url): headers = { "User-... 阅读全文
posted @ 2019-07-02 23:11
KD_131
阅读(2090)
评论(0)
推荐(0)
摘要:
优化成redis增量式获取数据 阅读全文
posted @ 2019-07-02 23:09
KD_131
阅读(516)
评论(0)
推荐(0)
摘要:
# 设置随机请求头 设置代理ip # 在middleware.py文件中 写一个类 class MiddlewearproDownloaderMiddleware(object): user_agent_list = [ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 " "(KHTML,... 阅读全文
posted @ 2019-07-02 23:03
KD_131
阅读(287)
评论(0)
推荐(0)
摘要:
阅读全文
posted @ 2019-07-02 23:02
KD_131
阅读(774)
评论(0)
推荐(0)
摘要:
# 简书网 # 数据保存在mysql中; 将selenium+chromedriver集成到scrapy; 整个网站数据爬取 # 抓取ajax数据 #爬虫文件 # -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors impor 阅读全文
posted @ 2019-07-02 23:01
KD_131
阅读(421)
评论(0)
推荐(0)
摘要:
# 爬虫文件 # -*- coding: utf-8 -*- import scrapy import re from soufangwang.items import NewHouseItem,SecondhandHouseItem class FangspiderSpider(scrapy.Spider): name = 'fangSpider' allowed_doma... 阅读全文
posted @ 2019-07-02 22:59
KD_131
阅读(391)
评论(0)
推荐(0)
摘要:
# 图片 下载耗时 用多线程 # threading模块 import threading import time def coding(): for i in range(3): print("正在写代码%s"%i) time.sleep(1) def drawing(): for i in range(3): print(... 阅读全文
posted @ 2019-07-02 22:57
KD_131
阅读(207)
评论(0)
推荐(0)
摘要:
# 获取加载更多的数据有 2 种方法# 第一种就是直接找数据接口, 点击'加载更多' 在Network看下, 直接找到数据接口 # 第二种方法就是使用selenium+chromdriver 阅读全文
posted @ 2019-07-02 22:53
KD_131
阅读(631)
评论(0)
推荐(0)
摘要:
# scrapy框架里下载问价和图片 # 判断文件夹和路径是否存在 # 爬虫文件 import scrapy from bmw.items import BmwItem class Bme5Spider(scrapy.Spider): name = 'bme5' allowed_domains = ['car.autohome.com.cn'] start_urls ... 阅读全文
posted @ 2019-07-02 22:49
KD_131
阅读(922)
评论(0)
推荐(0)
摘要:
#转义字符和原生字符 import re # # # 转义 # text = 'apple price is $299' # ret = re.search('\$\d+',text) # print(ret.group()) # # 原生字符串 text = '\c' ret = re.match('\\\\c',text) print(ret.group()) # group 分组 ... 阅读全文
posted @ 2019-07-02 22:46
KD_131
阅读(401)
评论(0)
推荐(0)
摘要:
# qiutu 多线程 from lxml import etree import requests import os from urllib import request import threading from queue import Queue class Producer(threading.Thread): headers = { "User-Ag... 阅读全文
posted @ 2019-07-02 22:43
KD_131
阅读(157)
评论(0)
推荐(0)
摘要:
# 打开服务端 直接执行abc.bat文件,如果执行闪退可以把data文件夹里的mongod.lock文件先删除 打开cmd窗口, 输入mongo,启动客户端. 也可以通过NoSQLBooster启动客户端 # mongodb 部分基本操作命令 db: 查看当前的数据库 show dbs: 查看所有数据库 use 数据库名:切换数据库 db.dropDatabase():删除当前指... 阅读全文
posted @ 2019-07-02 22:42
KD_131
阅读(361)
评论(0)
推荐(0)
摘要:
插入 阅读全文
posted @ 2019-07-02 22:40
KD_131
阅读(229)
评论(0)
推荐(0)
摘要:
import requests import csv from pyecharts import Bar url = 'https://xueqiu.com/hq?page=1#exchange=US&firstName=3&secondName=3_0' headers = { "User-Agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebK... 阅读全文
posted @ 2019-07-02 22:36
KD_131
阅读(544)
评论(0)
推荐(0)
摘要:
items start 阅读全文
posted @ 2019-07-02 22:35
KD_131
阅读(271)
评论(0)
推荐(0)
摘要:
同步下载 表情包的异步下载 阅读全文
posted @ 2019-07-02 22:30
KD_131
阅读(242)
评论(0)
推荐(0)
摘要:
threading模块 condition的生产者消费者模式 lock版的生产者消费者模式 queue的线程安全 threading类实现多线程 selenium关闭页面和浏览器 selenium页面等待 selenium打开多个页面和页面间的切换 多线程共享全局变量 selenium设置代理ip 阅读全文
posted @ 2019-07-02 22:27
KD_131
阅读(294)
评论(0)
推荐(0)
摘要:
https://blog.csdn.net/zztingfeng/article/details/80155624 阅读全文
posted @ 2019-07-02 10:10
KD_131
阅读(807)
评论(0)
推荐(0)
摘要:
本节掌握内容: MySQL的介绍安装、启动 windows上制作服务 MySQL破解密码 MySQL中统一字符编码 MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,目前属于 Oracle 旗下公司。MySQL 最流行的关系型数据库管理系统,在 WEB 应用方面MySQL是最好 阅读全文
posted @ 2019-07-02 10:09
KD_131
阅读(224)
评论(0)
推荐(0)
浙公网安备 33010602011771号