前提是要把自动化环境搭建好了 用Python调用webdriver框架的API,自动打开火狐浏览器,自动输入百度网址 1.第一步:从selenium里面导入webdriver模块2.打开Firefox浏览器3.打开百度网址 ...
分类:
编程语言 时间:
2017-09-18 22:20:56
阅读次数:
249
1. 应用场景 模拟ssh, telnet远程登录, 模拟ftp文件上传 2. 安装 参考资料: 《pexpect实例分析》https://www.ibm.com/developerworks/cn/linux/l-cn-pexpect2/ ...
分类:
编程语言 时间:
2017-09-17 17:27:41
阅读次数:
137
尝试编写12306网站查询余票信息的自动化脚本时,碰到日期选择的问题,此处做一下记录: 最初打算直接定位,但发现2017-09-30这一天实在没什么特点,虽然也可以根据父元素的特征属性层层定位,然后选择其下的第多少个child元素,但是感觉会有问题,过一天之后,这个child元素就不是30号了,与初 ...
分类:
编程语言 时间:
2017-09-16 20:48:22
阅读次数:
366
1、创建项目 2、创建models from django.db import models # Create your models here. # 主机表 class Host(models.Model): # 主机名 hostname = models.CharField(max_length ...
分类:
编程语言 时间:
2017-09-15 16:38:12
阅读次数:
254
Appium+python自动化8-Appium Python API 前言: Appium Python API全集,不知道哪个大神整理的,这里贴出来分享给大家。 1.contexts contexts(self): Returns the contexts within the current ...
分类:
移动开发 时间:
2017-09-13 12:02:57
阅读次数:
257
今日概要: 1、cookie和session 2、csrf 跨站请求伪造 3、自定义分页 ...
分类:
编程语言 时间:
2017-09-08 01:21:03
阅读次数:
192
安装ddt pip install ddt 直接上代码: ...
分类:
编程语言 时间:
2017-09-05 01:42:49
阅读次数:
395
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 #! /usr/bin/env python # ...
分类:
编程语言 时间:
2017-09-05 00:10:57
阅读次数:
308
#!/usr/bin/envpython
#-*-coding:utf-8-*-
#__author__="chenhao"
#Email:312779641@qq.com
#Date:2017/8/22
importparamiko
defsftp_exec_command(host,port,username,password,command):
ssh=paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolic..
分类:
编程语言 时间:
2017-09-04 22:29:35
阅读次数:
1748
使用python自动化运维书,其中一个例子是免秘钥scp文件。源代码:importpexpect
child=pexpect.spawn(‘scpdataroot@192.168.146.134:~‘)
child.expect(‘password:‘)
child.sendline(‘118530‘)使用脚本执行一直不能传输文件成功,后来通过日志查询,程序没有执行完毕,加上pexcep..
分类:
其他好文 时间:
2017-09-02 00:09:24
阅读次数:
164