Myluzh Blog

Strive to become a dream architect.

python+selenium+Chrome options参数

2021-5-27 myluzh Python

Chrome Options常用的行为一般有以下几种: 禁止图片和视频的加载:提升网页加载速度。 添加代理:用于FQ访问某些页面,或者应对IP访问频率限制的反爬技术。 使用移动头:访问移动端的站点,一般这种站点的反爬技术比较薄弱。 添加扩展:像正常使用浏览器一样的功能。 设置编码:应对中文站,防止乱码。 阻止JavaScript执行 ... Chrome Options是一个配置chrome启动时属性的类,通过这个参数我们可以为Chrome添加如下参数: 设置 chrome 二进制文件位置 (binary_location) 添加启动参数 (add_argument) 添加扩展应用 (add_extension, add_encoded_extension) 添加实验性质的设置参数 (add_experimental_option) 设置调试器地址 (debugger_address) 针对编码格式的操作 # 设置默认编码为 utf-8 from selenium import webdriver options = webdriver.Chrome...

阅读全文>>

标签: python selenium Chrome options 自动化

评论(0) (623)

小米社区自动回复刷积分进内测组 python3代码

2021-5-19 myluzh Python

[该文章已设置加密,请点击标题输入密码访问]

标签: python 小米社区 积分 内测

评论(0) (48)

AWVS批量添加扫描站点 python3脚本

2021-5-9 myluzh Python

经测试在AWVS13、AWVS14中可用。 说明; 1、self.scanner替换成自己AWVS地址 2、self.api替换成自己AWVS里的APIkey 3、self.speed设置扫描的速度(sequential|slow|moderate|fast),默认为fast 在脚本同目录下新建一个awvs.txt的文件,在里面导入你要批量扫描的网址,运行脚本即可。 import json import queue import requests requests.packages.urllib3.disable_warnings() def run(): print('Github:https://github.com/BetterDefender/AwvsBatchImport.git') print('Author:BetterDefender') print('Version:1.1') class AwvsScan(object): def __init__(self): self.scanner = 'http...

阅读全文>>

标签: awvs

评论(0) (1555)

python3+selenium实现web自动化

2021-3-5 myluzh Python

0x01 Selenium安装 Selenium 的安装很简单,可采用如下方式。 pip3 install selenium Selenium安装好之后,并不能直接使用,它需要与浏览器进行对接。这里拿Chrome浏览器为例。若想使用Selenium成功调用Chrome浏览器完成相应的操作,需要通过ChromeDriver来驱动。 0x02 ChromeDriver的安装 ChromeDriver的官方下载地址:https://chromedriver.storage.googleapis.com/index.html 下载之前先确认下我们使用的Chrome浏览器版本,找到与之对应的Chrome浏览器版本,根据你电脑系统的平台类型进行下载。 下载完成后解压,Windows将其放置在Python安装路径下Scripts文件夹中即可,macOS将chromedriver放置到/usr/local/bin/即可。 0x03 测试ChromeDriver 上述操作结束后,我们执行如下命令,测试一下 from selenium import webdriver # 打开Chrome浏览器 bro...

阅读全文>>

评论(0) (855)

python3 itchat微信自动回复机器人

2020-12-19 myluzh Python

import itchat import requests import random import time def get_response(msg): url = 'http://i.itpk.cn/api.php'#自动回复API接口 data = { #接口参数 'api_key': 'xxxx', # Tuling Key,API的值 'api_secret': 'xxxx', # Tuling Key,API的值 'question': msg, # 发出去的消息 'type':'普通文本', 'limit':'8' } print('提出问题',msg) rqq = requests.post(url, data=data) # 当自动检测编码不正确时,手动指定编码 rqq.encoding = 'utf-8' print('响应内容:', rqq.text) time.sleep(random.ra...

阅读全文>>

标签: itchat 自动回复 python3

评论(0) (622)

python itchat拦截微信群或好友撤回消息

2020-11-26 myluzh Python

import sys import os, re, shutil, time, collections, json from html.parser import HTMLParser from xml.etree import ElementTree as ETree import itchat from itchat.content import * msg_store = collections.OrderedDict() timeout = 600 sending_type = {'Picture': 'img', 'Video': 'vid'} data_path = 'data' nickname = '' bot = None if __name__ == '__main__': if not os.path.exists(data_path): os.mkdir(data_path) # if the QR code doesn't show correctly, you can try to change the value ...

阅读全文>>

标签: itchat python3

评论(0) (556)