# 1.导入urllib中的request # 2.定义爬取的url(统一资源定位符) # 3.定义一个请求对象request # request的参数有url:访问的网址;data:发起请求时带的数据请求方式为post; # headers:包括发送HTTP报文的键值对(例如user-agent请 ...
分类:
Web程序 时间:
2020-03-23 15:20:29
阅读次数:
79
# 使用parse对网址进行拼接操作 from urllib import request,parse base_url = 'https://www.baidu.com/s?' wd = input('请输入查询信息>>') query_msg = { 'wd':wd } msg = parse. ...
分类:
Web程序 时间:
2020-03-23 15:15:27
阅读次数:
78
环境变量: ZBX_HOSTNAME: #传入zabbix-agent.conf 中Hostname的值 ZBX_SERVER_HOST #此变量是Zabbix服务器或Zabbix代理的IP或DNS名称 ZBX_PASSIVE_ALLOW #此变量为布尔值(true或false),并启用或禁用被动检 ...
分类:
其他好文 时间:
2020-03-23 00:16:17
阅读次数:
92
一、logstash结合redis收集系统日志 架构图: 环境准备: A主机:elasticsearch主机 IP地址:192.168.7.100 B主机:logstash主机 IP地址:192.168.7.102 C主机:redis主机 IP地址:192.168.7.103 D主机:logstas ...
分类:
其他好文 时间:
2020-03-22 15:50:50
阅读次数:
67
1、在/etc/nginx/conf.d目录下(因Nginx的安装区别,可能站点配置文件的路径有所不同)新建文件deny_agent.config配置文件: #forbidden Scrapy if ($http_user_agent ~* (Scrapy|Curl|HttpClient)) { r ...
分类:
Web程序 时间:
2020-03-22 01:50:06
阅读次数:
370
import requests from lxml import etree url="https://s.weibo.com/top/summary?Refer=top_hot&topnav=1&wvr=6" header={'User-Agent':'Mozilla/5.0 (Windows N ...
分类:
其他好文 时间:
2020-03-21 23:28:23
阅读次数:
126
import requestsimport bs4 url = "https://search.bilibili.com/all?keyword=%E7%BA%AA%E5%BD%95%E7%89%87"header={'User-Agent':""}de = requests.get(url)de. ...
分类:
其他好文 时间:
2020-03-21 21:04:39
阅读次数:
95
import requests from lxml import etree url="https://s.weibo.com/top/summary?Refer=top_hot&topnav=1&wvr=6" header={'User-Agent':'Mozilla/5.0 (Windows N ...
分类:
其他好文 时间:
2020-03-21 18:10:42
阅读次数:
177
import requests from lxml import etree url="https://s.weibo.com/top/summary?Refer=top_hot&topnav=1&wvr=6" header={'User-Agent':'Mozilla/5.0 (Windows N ...
分类:
其他好文 时间:
2020-03-21 18:07:45
阅读次数:
59
import requestsfrom bs4 import BeautifulSoupurl = 'https://s.weibo.com/top/summary?cate=realtimehot'headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6 ...
分类:
其他好文 时间:
2020-03-21 16:34:43
阅读次数:
142