
selenium 内嵌窗口定位滚动

Selenium 配合 Chromedriver 爬取艺龙评价时,存在内嵌窗口,直接 JS 无法滚动,这里使用如下操作方法
if spider.name == 'elong':
for i in range(2):
rand = random.uniform(1, 4)
time.sleep(rand)
drag = self.driver.find_element_by_xpath("//li[@class='s_bdt'][last()-1]")
self.driver.execute_script("arguments[0].scrollIntoView();", drag)
time.sleep(2)
else:
for i in range(2):
rand = random.uniform(1, 4)
time.sleep(rand)
js = "window.scrollTo(0,document.body.scrollHeight)"
self.driver.execute_script(js)
print('Chrome driver success...')
Scrapy 一些记录
UnicodeEncodeError: 'gbk' codec can't encode character '\xee' in position 22

print(response.text.encode('gbk', 'ignore').decode('gbk'))
https://zhidao.baidu.com/question/1302043991323187059.html
Scrapyd 部署出现错误 builtins.AttributeError: ‘int’ object has no attribute ‘splitlines’
错误原因 twist 版本过高
Continue reading Scrapy 一些记录linux 使用 rz 和 sz 命令
yum install lrzsz
rz:从本地上传文件至服务器
sz filename:从服务器下载文件至本地
jQuery 模拟手动点击链接代码
html 文件
<a href="http://www.baidu.com" id='alipaybtn'>jquery点我</a>
jQuery 代码
var goPay = '<span id="goPay"> <span>';
//给A标签中的文字添加一个能被jQuery捕获的元素
$('#alipaybtn').append(goPay);
//模拟点击A标签中的文字
$('#goPay').click();
Seafile 6.3.4 开机启动 CentOS 7
安装目录

创建 systemd 服务文件 /etc/systemd/system/seafile.service
vim /etc/systemd/system/seafile.service
Continue reading Seafile 6.3.4 开机启动 CentOS 7 如何衡量云硬盘的性能 fio
fio --bs=4k --ioengine=libaio --iodepth=1 --direct=1 --rw=read --time_based --runtime=600 --refill_buffers --norandommap --randrepeat=0 --group_reporting --name=fio-read --size=100G --filename=/dev/vda1

动态添加的 checkbox 获取选中值
PHP5.6 找不到扩展
Linux 下 ssh 登陆慢常见解决办法
修改配置文件
vim /etc/ssh/sshd_config
//1.关闭ssh DNS反向解析
UseDNS no
//2.关闭 GSSAPI 的用户认证
GSSAPIAuthentication no

比如腾讯云……