2015年1月26日

摘要: 参考: http://blog.csdn.net/wangyangkobe/article/details/65951431. source命令source filename 与 sh filename 及./filename执行脚本的区别在那里呢?1.当shell脚本具有可执行权限时,用sh fi... 阅读全文
posted @ 2015-01-26 18:11 qihui 阅读(353) 评论(0) 推荐(0)
摘要: 参考: http://www.cnblogs.com/kym/archive/2011/12/29/2306428.htmlhttp://liuzhijun.iteye.com/blog/1872241virtualenv 主要是进行python环境变量管理,防止更改环境变量是对全局的环境变量造成影... 阅读全文
posted @ 2015-01-26 17:07 qihui 阅读(139) 评论(0) 推荐(0)
摘要: 学习自:http://blog.csdn.net/sislcb/article/details/4002414Python解释器:源代码-->字节码-->机器语言不同版本编译后的pyc文件是不同的python提供了内置库文件来实现将python编译成pyc文件。import py_compilepy... 阅读全文
posted @ 2015-01-26 15:21 qihui 阅读(131) 评论(0) 推荐(0)

2015年1月23日

摘要: read读取指定长度,返回字符串readline 每次读取一行readlines 将整个文件读取到内存中。对于大文件(大于内存)的处理,readline的一行行迭代影响效率。网上看到有个老外给了个很不错的处理办法:import iodef readInChunks(fileObj, chunkSiz... 阅读全文
posted @ 2015-01-23 16:10 qihui 阅读(116) 评论(0) 推荐(0)

2015年1月20日

摘要: 上传文件#定位上传按钮,添加本地文件driver.find_element_by_name("file").send_keys('D:\\selenium_use_case\upload_file.txt' )time.sleep(2)定位下拉框#先定位到下拉框m=driver.find_eleme... 阅读全文
posted @ 2015-01-20 16:43 qihui 阅读(245) 评论(0) 推荐(0)
摘要: 鼠标事件:ActionChains 类 context_click() 右击 double_click() 双击 drag_and_drop() 拖动鼠标右键:from selenium.webdriver.common.action_chains import ActionChains #导... 阅读全文
posted @ 2015-01-20 15:16 qihui 阅读(175) 评论(0) 推荐(0)

2015年1月13日

摘要: 获取文本:#id = cp 元素的文本信息data=driver.find_element_by_id("cp").text获取属性值:select = driver.find_element_by_tag_name("select")allOptions = select.find_element... 阅读全文
posted @ 2015-01-13 15:34 qihui 阅读(158) 评论(0) 推荐(0)

2015年1月8日

摘要: browser.find_element_by_id("su").click()#css:driver.find_element_by_css_selector("a[name=\"tj_news\"]").click()#xpath:driver.find_element_by_xpath("//... 阅读全文
posted @ 2015-01-08 15:45 qihui 阅读(171) 评论(0) 推荐(0)

导航