safari

python 采集斗图啦(多线程)

徘徊边缘 提交于 2020-08-05 04:54:57
import concurrent import requests; from concurrent.futures import ThreadPoolExecutor import os; import parsel; def send_request(url): header = { "user-agent":'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36' } requests.packages.urllib3.disable_warnings() response = requests.get(url,headers=header) return response def pare_data(data): selector = parsel.Selector(data) result_list = selector.xpath('//a[@class="col-xs-6 col-sm-3"]') for result in result_list: title = result.xpath('./img/@alt').get() src_url = result.xpath('.

短信接口防恶意攻击策略

懵懂的女人 提交于 2020-08-05 04:46:59
如下是用户页面交互。输入手机号,即可获取验证码。用户体验方面已经超级简单了。 不过,简单是要有成本的。安全控制方面,程序员得琢磨。 在系统安全、信息安全、系统安全防御领域,短信盗刷是老生常谈的话题了。我们公司的系统也经历过至少3次盗刷。每次动辄损失2万~5万条的短信。 近几年,随着qq授权登录、微信授权登录等登录方式的流行,短信盗刷的情况似乎是少了。不过,互联网企业总是习惯要留下用户的手机号的,毕竟这么做非常利于流量获取。 短信验证码登陆,通常的做法是图形验证码。简单实现的话,就是 当用户输入的手机号发生变化时,页面异步请求服务端生成图形验证码的接口,服务端返回图片文件流,页面生成验证码图片。用户输入验证码,然后请求服务端获取验证码的接口。服务端会校验用户输入的验证码是否正确,正确了才会发送短信验证码。 因为图形验证码是通过文件流传输的,所以很难破解。当然,倒是有识别图片的工具,不管怎么说,还是有一定难度的。不识别图片呢?随机生成4位验证码,用撞库的方式来恶搞?显然,命中的几率也很小。就是说,用图形正麻烦的方式,恶意攻击的难度比较大。 我们看12306或其他的互联网网站,动不动让选特定的图形,或滑动拼图,或依次选特定的文字,这种安全性都是相当高的。 据说,阿里的招数更绝!可以记录鼠标在页面的轨迹,进而识别出来是人在操作,而非机器模拟。 所谓安全,安防,说白了,是防君子不防小人的

nodejs 用 axios 向osc服务器上传图片[需要cookie]

偶尔善良 提交于 2020-08-05 00:10:47
通过http请求查看request数据, 复制请求头和cookie 代码 const axios = require('axios') const fs = require('fs') const img_path = './t2.jpg' const FormData = require("form-data"); const url = "https://my.oschina.net/ahaoboy/space/ckeditor_dialog_img_upload" const headers = { "accept": "*/*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "cookie": "===", "referrer": "https://my.oschina.net/ahaoboy/blog/write/4326713", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103

五分钟了解浏览器的工作原理

一曲冷凌霜 提交于 2020-08-04 23:16:27
Web 浏览器无疑是用户访问互联网最常见的入口。浏览器凭借其免安装和跨平台等优势,逐渐取代了很多传统的富客户端。 Web 浏览器通过向 URL 发送网络请求来访问 Web 服务器资源,并以交互性的方式展示这些内容。基本操作包括获取、处理、显示和存储。常见的浏览器包括 Internet Explorer、Firefox、谷歌 Chrome、Safari 和 Opera 等。 架构图 浏览器主要由以下几个部分组成: 用户界面 浏览器引擎 渲染引擎 数据存储层 UI BackEnd JavaScript 解析器 (脚本引擎) 网络层 用户界面 这是用户与浏览器发生交互的区域。浏览器的外观没有特定的标准,HTML5 规范没有规定 UI 元素该长什么样,但是列了一些常见元素:地址栏、个人信息栏、滚动条、状态栏和工具栏等。 浏览器引擎 它提供了 UI 与底层渲染引擎之间的接口,根据用户交互进行查询和操控渲染引擎,提供初始化加载 URL 的方法,并负责重新加载、返回和前进等操作。 渲染引擎 渲染引擎负责在屏幕上显示网页内容。渲染引擎的主要工作是解析 HTML。渲染引擎默认可展示 HTML、XML和图片,还可以通过插件或扩展程序支持其他数据类型。 现代浏览器使用不同的渲染引擎。 Gecko : Firefox Webkit :Safari Blink :Chrome, Opera (version

python 采集斗图啦xpath

主宰稳场 提交于 2020-08-04 22:44:26
import requests; import re; import os; import parsel; 1.请求网页 header = { "user-agent":'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36' } response = requests.get(' https://www.doutula.com/photo/list/',headers=header ) html = response.text 2.解析网页 selector = parsel.Selector(html) print(selector) dir_name = 'doutu_list' if not os.path.exists(dir_name): os.mkdir(dir_name) result_list = selector.xpath('//a[@class="col-xs-6 col-sm-3"]') for result in result_list: title = result.xpath('./img/ @alt ').get() img_url = result.xpath

ubuntu下的curl命令你知道怎么用吗?

空扰寡人 提交于 2020-08-04 18:12:21
cURL(CommandLine Uniform Resource Locator)是一个利用URL语法在命令行下工作的文件传输工具,1997年首次发行。它支持文件上传和下载,所以是综合传输工具,但按传统,习惯称cURL为下载工具。cURL还包含了用于程序开发的libcurl。 curl命令参数很多,这里只列出我曾经用过、特别是在shell脚本中用到过的那些。 -v/--verbose 小写的v参数,用于打印更多信息,包括发送的请求信息,这在调试脚本是特别有用。 -m/--max-time <seconds> 指定处理的最大时长 -H/--header <header> 指定请求头参数 -s/--slient 减少输出的信息,比如进度 --connect-timeout <seconds> 指定尝试连接的最大时长 -x/--proxy <proxyhost[:port]> 指定代理服务器地址和端口,端口默认为1080 -T/--upload-file <file> 指定上传文件路径 -o/--output <file> 指定输出文件名称 -d/--data/--data-ascii <data> 指定POST的内容 --retry <num> 指定重试次数 -e/--referer <URL> 指定引用地址 -I/--head 仅返回头部信息,使用HEAD请求 1 get请求

为什么 macx.cn 网站无法使用mac下的firefox打开

孤人 提交于 2020-08-04 11:40:22
正在试图写一个ssl的检测工具 doit-ssl-checker , 顺便使用工具对 https://www.macx.cn 进行测试. 居然返回错误! # yongfu @ yfmac in ~/git/gitee.com/RickieL/doit-ssl-checker on git:master x [20:45:41] $ go run main.go -d www.macx.cn -l [error]: x509: certificate signed by unknown authority 说证书是被未知机构颁发的或者是自签名的证书. 好家伙, 赶紧用chrome进行打开, 嘿嘿嘿, 没问题呀, 打开一切正常. 有点自我怀疑了, 难道是我写的工具有问题? 用firefox打开试试, 出现了一个大大的告警. 和我的工具显示的错误类似, 进一步检查Firefox, 地址栏上的锁有一个感叹号, 点击感叹号. 点击 "箭头" 后, 再点击 "更多信息" 再点击 "查看证书", 可以直接查看 www.macx.cn 的证书了. 和正常的网址对比, 可以发现, 应该是 www.macx.cn 只提供了自己的域名证书, 没有把对应的颁发机构的证书一起配置在服务器上. 但是firefox和我的ssl检测工具 doit-ssl-checker 会对颁发机构的证书进行验证. 嗯,

GitLab 502问题的解决

孤者浪人 提交于 2020-08-04 09:29:53
问题: 502 Whoops, GitLab is taking too much time to respond. 日志: [root@cs12-66-gitlab ~]# my gitlab-ctl tail -bash: my: command not found [root@cs12-66-gitlab ~]# gitlab-ctl tail ==> /var/log/gitlab/gitlab-shell/gitlab-shell.log <== # Logfile created on 2018-02-02 14:34:26 +0800 by logger.rb/56438 ==> /var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-2018-02-02-14-34-39.log <== -> 0.3182s == Seed from /opt/gitlab/embedded/service/gitlab-rails/db/fixtures/production/001_admin.rb Administrator account created: login: root password: You'll be prompted to create one on your first visit. == Seed

Transform: rotate doesn't work in Safari

a 夏天 提交于 2020-08-04 06:56:54
问题 I want to create a flipbox which rotate from front to back - on the front side there is a text and also on the back side.The problem is that even though it rotates, both texts from front and back side are visible together when the box rotates. And the text from the back side is visible at first instead the text from the front side. Maybe someone has an idea why? Everything is working without problems in Chrome. .box { width: 155px; height: 125px; position: relative; display: inline-block;

Want to have browser viewport resize when iOS keyboard is activated

旧城冷巷雨未停 提交于 2020-08-02 07:44:54
问题 In iOS web browsers (Safari, Chrome, etc.), when you click into an input field and the keyboard displays, it keeps the viewport the same size but slides it up partially out of view. This makes creating app-like websites very difficult, as I'm coding a chatting app and when the keyboard shows I want to keep the conversation completely in view, but simply resize the conversation area to fit in the new "resized" viewable area. I've tried everything, such as having the conversation area be