03 2020 档案

摘要:php-fpm超时时间设置request_terminate_timeout分析原创loophome 最后发布于2017-11-22 16:17:59 阅读数 21201 收藏展开今天发现了一个很神奇的事情,php日志中有一条超时的日志,但是我request_terminate_timeout中设置 阅读全文
posted @ 2020-03-30 11:42 brady-wang 阅读(331) 评论(0) 推荐(0) 编辑
摘要:import numpy a = numpy.array([[1,2], [3,4]]) b = numpy.array([[5,6], [7,8]]) a*b >>>array([[ 5, 12], [21, 32]]) a.dot(b) >>>array([[19, 22], [43, 50]] 阅读全文
posted @ 2020-03-24 14:14 brady-wang 阅读(893) 评论(0) 推荐(0) 编辑
摘要:C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp 阅读全文
posted @ 2020-03-24 11:27 brady-wang 阅读(438) 评论(0) 推荐(0) 编辑
摘要:import re from time import sleep from lxml import etree from selenium import webdriver options = webdriver.ChromeOptions() #options.add_argument('--he 阅读全文
posted @ 2020-03-21 18:25 brady-wang 阅读(269) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2020-03-20 18:20 brady-wang 阅读(0) 评论(0) 推荐(0) 编辑
摘要:安装conda后取消命令行前出现的base,取消每次启动自动激活conda的基础环境 方法一: 每次在命令行通过conda deactivate退出base环境回到系统自动的环境 方法二 1,通过将auto_activate_base参数设置为false实现: conda config --set 阅读全文
posted @ 2020-03-20 17:31 brady-wang 阅读(1685) 评论(0) 推荐(0) 编辑
摘要:google-chrome --version 阅读全文
posted @ 2020-03-20 16:58 brady-wang 阅读(5574) 评论(0) 推荐(1) 编辑
摘要:import osfrom selenium import webdriverimport time,jsonclass Cookie(object): def __init__(self,driver,login_url,url,web_name): self.driver = driver se 阅读全文
posted @ 2020-03-19 16:31 brady-wang 阅读(387) 评论(0) 推荐(0) 编辑
摘要:解决selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'expiry' 浏览器添加cookies with open('cookies', 'r', encoding='ut 阅读全文
posted @ 2020-03-19 15:40 brady-wang 阅读(7276) 评论(0) 推荐(0) 编辑
摘要:#-*- coding:utf8 -*- # 导入selenium2中的webdriver库 from time import sleep from selenium import webdriver from selenium.webdriver.chrome.options import Opt 阅读全文
posted @ 2020-03-19 15:16 brady-wang 阅读(398) 评论(0) 推荐(0) 编辑
摘要:概述 csv是最通用的文件格式,本质是文本文件,用记事本即可打开。同一行中每个字段间用逗号分隔,在csv中显示的是在不同单元格中,在记事本中显示的是一行中用逗号分隔。 xls是excel专用格式,是二进制文件,只有excel才能打开。 CSV操作 csv写入 1.写入列表(list)数据 使用 cs 阅读全文
posted @ 2020-03-19 10:22 brady-wang 阅读(785) 评论(0) 推荐(0) 编辑
摘要:# -*- coding: utf-8 -*- import scrapy class TestSpider(scrapy.Spider): name = 'test' allowed_domains = ['yeves.cn'] start_urls = ['https://yeves.cn/'] 阅读全文
posted @ 2020-03-19 10:15 brady-wang 阅读(707) 评论(0) 推荐(0) 编辑
摘要:使用的是python3.7的环境,解析数据要用xpath,系统是mac pip install lxml一分钟后。。。下载成功 开始写代码, from lxml import etree挂了…,lxml中竟然没有etree模块 换个方法 from lxml import htmlet = html. 阅读全文
posted @ 2020-03-17 17:22 brady-wang 阅读(2927) 评论(0) 推荐(0) 编辑
摘要:# -*- coding: utf-8 -*- import re from time import sleep import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import Craw 阅读全文
posted @ 2020-03-17 13:12 brady-wang 阅读(432) 评论(0) 推荐(0) 编辑
摘要:去除数字,特殊字符,只保留汉字 ? 1 2 3 4 5 6 7 8 import re s = '1123*#中abc国' str = re.sub('[a-zA-Z0-9'!"#%&\'()*+,-./:;<=>?@,。?★、…【】《》?“”‘'![\\]^_`{|}~\s]+', "", 阅读全文
posted @ 2020-03-17 11:48 brady-wang 阅读(21935) 评论(0) 推荐(0) 编辑
摘要:# -*- coding: utf-8 -*- import csv import scrapy class GjSpider(scrapy.Spider): name = 'gj' allowed_domains = ['ganji.com'] start_urls = ['http://sz.g 阅读全文
posted @ 2020-03-16 17:39 brady-wang 阅读(360) 评论(0) 推荐(0) 编辑
摘要:# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrap 阅读全文
posted @ 2020-03-16 16:43 brady-wang 阅读(1318) 评论(0) 推荐(0) 编辑
摘要:Python中xlrd和xlwt模块使用方法 阅读目录 安装 xlrd模块使用 xlwt模块 xlrd模块实现对excel文件内容读取,xlwt模块实现对excel文件的写入。 回到顶部 安装 ? 1 2 pip install xlrd pip install xlwt 回到顶部 xlrd模块使用 阅读全文
posted @ 2020-03-16 16:05 brady-wang 阅读(874) 评论(0) 推荐(0) 编辑
摘要:1 setting里面启动管道 ITEM_PIPELINES = { 'ganji.pipelines.GanjiPipeline': 300,}2 拿到的数据通过yield返回给管道 # -*- coding: utf-8 -*- import csv import scrapy class Gj 阅读全文
posted @ 2020-03-16 15:53 brady-wang 阅读(567) 评论(0) 推荐(0) 编辑
摘要:import matplotlib.pyplot as plt import matplotlib as mpl baseclass=[1,2,3,4] name = ['class1','class2','class3','class4'] scores = [67,79,89,50] plt.t 阅读全文
posted @ 2020-03-15 20:42 brady-wang 阅读(8882) 评论(0) 推荐(0) 编辑
摘要:import matplotlib.pyplot as plt import matplotlib as mpl # 支持中文 plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签 plt.rcParams['axes.unicode_m 阅读全文
posted @ 2020-03-15 20:13 brady-wang 阅读(177) 评论(0) 推荐(0) 编辑
摘要:一、环境描述 python 3.7 mac 10.14.5 二、问题描述 如下图所示,当使用matplotlib绘制图片的时候,所有的中文字符无法正常显示。 三、解决方法 1、下载字体ttf文件 链接:https://pan.baidu.com/s/1RLVvbIi_NpAiiycBYQRPCQ 密 阅读全文
posted @ 2020-03-15 20:08 brady-wang 阅读(439) 评论(0) 推荐(0) 编辑
摘要:import matplotlib.pyplot as plt1 import matplotlib as mpl x = range(1,11) y = [11,22,13,45,3,2,3,4,5,6] plt1.plot(x,y) plt1.show() x 和y 个数不一致就报错 Value 阅读全文
posted @ 2020-03-15 19:40 brady-wang 阅读(361) 评论(0) 推荐(0) 编辑
摘要:三个班级平均分 import matplotlib.pyplot as plt import matplotlib as mpl classes = ['class1','class2','class3','class4'] scores = [67,79,89,50] plt.bar(classe 阅读全文
posted @ 2020-03-15 19:16 brady-wang 阅读(193) 评论(0) 推荐(0) 编辑
摘要:import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.font_manager import FontProperties font = FontProperties(fname='/System/Libra 阅读全文
posted @ 2020-03-15 19:08 brady-wang 阅读(207) 评论(0) 推荐(0) 编辑
摘要:import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.font_manager import FontProperties font = FontProperties(fname='/System/Libra 阅读全文
posted @ 2020-03-15 18:51 brady-wang 阅读(435) 评论(0) 推荐(0) 编辑
摘要:下载minianaconda 安装 进入cmd下 conda create --name python37 python=3.7 创建python3.7环境 conda activate python37 激活刚刚的环境 conda install jupyter 安装jupyter conda i 阅读全文
posted @ 2020-03-15 18:25 brady-wang 阅读(591) 评论(0) 推荐(0) 编辑
摘要:<!-- 鼠标 --> <style type="text/css"> * { cursor: url('https://blog-static.cnblogs.com/files/ogurayui/cursor_icon.ico'), auto;}</style> 阅读全文
posted @ 2020-03-15 11:01 brady-wang 阅读(146) 评论(0) 推荐(0) 编辑
摘要:此教程实时更新,请放心使用;如果有新版本出现猪哥都会第一时间尝试激活; pycharm官网下载地址:http://www.jetbrains.com/pycharm/download/ 激活前准备工作 配置文件修改已经不在bin目录下直接修改,而是通过pycharm修改如果输入code一直弹出来,请 阅读全文
posted @ 2020-03-15 08:31 brady-wang 阅读(739) 评论(0) 推荐(0) 编辑
摘要:import requests from lxml import etree import faker url = "https://www.yeves.cn/admin/Articles" fake = faker.Faker() headers = { "User-Agent":fake.use 阅读全文
posted @ 2020-03-14 16:50 brady-wang 阅读(1346) 评论(0) 推荐(0) 编辑
摘要:前言:在写入csv文件中,出现了乱码的问题。 解决:utf-8 改为utf-8-sig 区别如下: 1、”utf-8“ 是以字节为编码单元,它的字节顺序在所有系统中都是一样的,没有字节序问题,因此它不需要BOM,所以当用"utf-8"编码方式读取带有BOM的文件时,它会把BOM当做是文件内容来处理, 阅读全文
posted @ 2020-03-14 15:41 brady-wang 阅读(13703) 评论(0) 推荐(1) 编辑
摘要:import json from time import sleep import requests url = "https://web-api.juejin.im/query" headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Wi 阅读全文
posted @ 2020-03-14 14:14 brady-wang 阅读(503) 评论(0) 推荐(0) 编辑
摘要:import json import requests from lxml import etree from time import sleep url = "https://www.jianshu.com/shakespeare/notes/60479187/comments?page=1&co 阅读全文
posted @ 2020-03-14 11:35 brady-wang 阅读(297) 评论(0) 推荐(0) 编辑
摘要:点击评论,出现异步加载的请求 import json import requests from lxml import etree from time import sleep url = "https://www.zhihu.com/api/v4/answers/974431591/root_co 阅读全文
posted @ 2020-03-14 11:29 brady-wang 阅读(1489) 评论(0) 推荐(1) 编辑
摘要:import json import requests from lxml import etree from time import sleep url = "https://sz.lianjia.com/ershoufang/rs/" headers = { "User-Agent":"", " 阅读全文
posted @ 2020-03-14 11:18 brady-wang 阅读(379) 评论(0) 推荐(0) 编辑
摘要:import osfrom time import sleepimport fakerimport requestsfrom lxml import etreefake = faker.Faker()base_url = "http://angelimg.spbeen.com"def get_nex 阅读全文
posted @ 2020-03-13 13:42 brady-wang 阅读(1918) 评论(0) 推荐(0) 编辑
摘要:from time import sleep import faker import requests from lxml import etree fake = faker.Faker() base_url = "http://angelimg.spbeen.com" def get_next_l 阅读全文
posted @ 2020-03-13 12:25 brady-wang 阅读(3697) 评论(0) 推荐(0) 编辑
摘要:totalNumbers = re.findall(r'\d+',str) 阅读全文
posted @ 2020-03-13 10:59 brady-wang 阅读(1350) 评论(0) 推荐(0) 编辑
摘要:import random import requests url = "http://tool.yeves.cn" import faker fake = faker.Faker() uaList = [] for i in range(0,10): uaList.append(fake.user 阅读全文
posted @ 2020-03-13 10:54 brady-wang 阅读(570) 评论(0) 推荐(0) 编辑
摘要:import requests url = "http://www.spbeen.com" headers = { "User-Agent":"teste" } response = requests.get(url,headers=headers) print(response.status_co 阅读全文
posted @ 2020-03-13 10:18 brady-wang 阅读(394) 评论(0) 推荐(0) 编辑
摘要:import math import re import requests from lxml import etree type = "https://www.cnrepark.com/gyy/park{}/" urlList = [] for i in range(1,8): url = typ 阅读全文
posted @ 2020-03-12 16:52 brady-wang 阅读(490) 评论(0) 推荐(0) 编辑
摘要:from selenium import webdriver br = webdriver.Chrome() br.get("tps://study.163.com/") iframe = br.find_element_by_xpath("") br.switchto.frame(iframe) 阅读全文
posted @ 2020-03-12 10:55 brady-wang 阅读(200) 评论(0) 推荐(0) 编辑
摘要:from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument("--proxy-server=http://113.116.45.20:8118") br = webdriver.Chr 阅读全文
posted @ 2020-03-12 10:44 brady-wang 阅读(5946) 评论(0) 推荐(0) 编辑
摘要:from time import sleep from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() #options.add_argument( 阅读全文
posted @ 2020-03-12 10:34 brady-wang 阅读(379) 评论(0) 推荐(0) 编辑
摘要:from time import sleep js = ''' alist = document.getElementsByClassName("ui-page-next"); alist = alist[0]; alist.click(); ''' from selenium import web 阅读全文
posted @ 2020-03-12 10:07 brady-wang 阅读(320) 评论(0) 推荐(0) 编辑
摘要:from selenium import webdriver options = webdriver.ChromeOptions() prefs = {} prefs['profile.managed_default_content_settings.images'] = 2 options.add 阅读全文
posted @ 2020-03-12 09:56 brady-wang 阅读(387) 评论(0) 推荐(0) 编辑
摘要:from time import sleep from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() #options.add_argument( 阅读全文
posted @ 2020-03-12 09:49 brady-wang 阅读(1143) 评论(0) 推荐(0) 编辑
摘要:引入options即可 from time import sleep from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.ad 阅读全文
posted @ 2020-03-11 18:18 brady-wang 阅读(653) 评论(0) 推荐(0) 编辑
摘要:from time import sleep from selenium import webdriver br = webdriver.Chrome() url = "https://www.tmall.com" br.get(url) input = br.find_element_by_id( 阅读全文
posted @ 2020-03-11 18:10 brady-wang 阅读(689) 评论(0) 推荐(0) 编辑
摘要:from time import sleep from selenium import webdriver br = webdriver.Chrome() url = "https://www.tmall.com" br.get(url) input = br.find_element_by_id( 阅读全文
posted @ 2020-03-11 17:21 brady-wang 阅读(629) 评论(0) 推荐(0) 编辑
摘要:from time import sleep from selenium import webdriver br = webdriver.Chrome() url = "https://www.tmall.com" br.get(url) button = br.find_element_by_xp 阅读全文
posted @ 2020-03-11 16:54 brady-wang 阅读(892) 评论(0) 推荐(0) 编辑
摘要:find_element_by_name find_element_by_id find_element_by_xpath find_element_by_link_text find_element_by_partial_link_text find_element_by_tag_name fin 阅读全文
posted @ 2020-03-11 16:42 brady-wang 阅读(286) 评论(0) 推荐(0) 编辑
摘要:from time import sleep from selenium import webdriver browser = webdriver.Chrome() url = "http://www.spbeen.com/tool/request_info/" browser.get(url) c 阅读全文
posted @ 2020-03-11 16:20 brady-wang 阅读(174) 评论(0) 推荐(0) 编辑
摘要:下载地址 Chrome点击下载chrome的webdriver: http://chromedriver.storage.googleapis.com/index.html不同的Chrome的版本对应的chromedriver.exe 版本也不一样,下载时不要搞错了。如果是最新的Chrome, 下载 阅读全文
posted @ 2020-03-11 16:00 brady-wang 阅读(150) 评论(0) 推荐(0) 编辑
摘要:from requests_html import HTMLSession session = HTMLSession() headers = { "User-Agent":"scrapy" } resp = session.get('http://www.spbeen.com/tool/reque 阅读全文
posted @ 2020-03-11 15:23 brady-wang 阅读(1803) 评论(0) 推荐(1) 编辑
摘要:from requests_html import HTMLSessionsession = HTMLSession()resp = session.get('http://www.spbeen.com/tool/request_info/')ua = resp.html.xpath('.//div 阅读全文
posted @ 2020-03-11 14:59 brady-wang 阅读(958) 评论(0) 推荐(0) 编辑
摘要:child::book 选取所有属于当前节点的子元素的 book 节点。 attribute::lang 选取当前节点的 lang 属性。 child::* 选取当前节点的所有子元素。 attribute::* 选取当前节点的所有属性。 child::text() 选取当前节点的所有文本子节点。 c 阅读全文
posted @ 2020-03-11 13:56 brady-wang 阅读(226) 评论(0) 推荐(0) 编辑
摘要:from lxml import etree html = ''' <!DOCTYPE html> <html lang="en"> <head> <!--网页头部信息--> <title>网页名</title> </head> <body> <!--下面是网页正文--> <div class="t 阅读全文
posted @ 2020-03-11 13:32 brady-wang 阅读(617) 评论(0) 推荐(0) 编辑
摘要:from lxml import etree html = ''' <!DOCTYPE html> <html lang="en"> <head> <!--网页头部信息--> <title>网页名</title> </head> <body> <!--下面是网页正文--> <div class="t 阅读全文
posted @ 2020-03-11 13:31 brady-wang 阅读(2492) 评论(0) 推荐(0) 编辑
摘要:软件下载: 百度网盘下载 提取码: 73p7 激活操作: 1.下载jar包 JetbrainsCrack-4.2-release-enc.jar 链接:https://pan.baidu.com/s/1Vpg9PI2-PlAQD68yBGDNKQ 2,jia 包 放到bin 目录 里 3,修改两个配 阅读全文
posted @ 2020-03-11 11:07 brady-wang 阅读(1476) 评论(0) 推荐(0) 编辑
摘要:百度网盘提取地址 提取码: 753r 下载后放到软件目录即可使用 阅读全文
posted @ 2020-03-11 11:02 brady-wang 阅读(314) 评论(0) 推荐(0) 编辑
摘要:百度网盘下载 提取码: tsua 按照电脑安装32位或者64位 安装完成后点击最后一个进行破解汉化 阅读全文
posted @ 2020-03-11 10:54 brady-wang 阅读(4358) 评论(0) 推荐(0) 编辑
摘要:# coding=utf-8 import requests url = "http://test.yeves.cn/test_header.php" headers = { "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Apple 阅读全文
posted @ 2020-03-07 16:32 brady-wang 阅读(2306) 评论(0) 推荐(0) 编辑
摘要:#coding=utf-8 import requests url ="https://images.pexels.com/photos/1181767/pexels-photo-1181767.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940" he 阅读全文
posted @ 2020-03-07 14:15 brady-wang 阅读(4333) 评论(0) 推荐(0) 编辑
摘要:逐层检索和全局检索 布啦豆 11203 本节主要介绍用xpath来描述html的层级关系 主要使用到的知识点如下: 单独的一个点 .,表示当前位置 两个点 ..,表示上一级父标签的位置 单独的一个斜杠 /,表示只检索下面一级 单独的两个斜杠 //,表示检索下面全部位置 下标 [数字]:从1开始,依次 阅读全文
posted @ 2020-03-05 10:51 brady-wang 阅读(474) 评论(0) 推荐(0) 编辑
摘要:通过ID和Class检索 必备知识点 在html中,id是唯一的 在html中,class是可以多处引用的 工具 Python3版本 lxml库【优点是解析快】 HTML代码块【从网络中获取或者自己杜撰一个】 requests【推荐安装,从网页上获取网页代码练手,再好不过了】 Xpath学习 先定义 阅读全文
posted @ 2020-03-05 10:50 brady-wang 阅读(672) 评论(0) 推荐(0) 编辑
摘要:wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh chmod +x Miniconda3-latest-Linux-x86_64.sh ./Miniconda3-latest-Linux-x86_64 阅读全文
posted @ 2020-03-05 10:42 brady-wang 阅读(1313) 评论(0) 推荐(0) 编辑
摘要:#coding=utf-8 import os from time import sleep import requests import re from bs4 import BeautifulSoup headers = {'Accept': 'text/html,application/xht 阅读全文
posted @ 2020-03-04 14:22 brady-wang 阅读(317) 评论(0) 推荐(0) 编辑
摘要:进程和线程 阅读: 16788196 很多同学都听说过,现代操作系统比如Mac OS X,UNIX,Linux,Windows等,都是支持“多任务”的操作系统。 什么叫“多任务”呢?简单地说,就是操作系统可以同时运行多个任务。打个比方,你一边在用浏览器上网,一边在听MP3,一边在用Word赶作业,这 阅读全文
posted @ 2020-03-04 10:35 brady-wang 阅读(223) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示