
python
qq_26535453
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
双循环
#coding=utf-8 type=('a','b') tp=('c','d') for ty in type: #print ty+'ab' for tss in tp: #print ty #print tss print ty+tss for : 语句1 for :原创 2015-08-27 15:10:19 · 465 阅读 · 0 评论 -
firefxo 关闭导入向导
修改C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\profiles.ini 把IsRelative=1的值修改为 IsRelative=0原创 2015-09-24 14:49:35 · 387 阅读 · 0 评论 -
执行多个用例
在eclipse中 run as python unit-test时 可执行两个类。 # -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Key原创 2015-09-30 10:38:57 · 1248 阅读 · 0 评论 -
python 操作文本编辑器
遇到非常规的上传文件: 参考:http://blog.chinaunix.net/uid-26235486-id-3362291.html js1="var s=document.getElementById(\"snid1\");s.value=\"0\";" js2="var q=document.getElementById(\"snu1\");q.val原创 2015-09-30 09:33:18 · 725 阅读 · 0 评论 -
python 初始化测试方法
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from原创 2015-09-30 10:03:19 · 560 阅读 · 0 评论 -
python打开自已配置的firefox
firefox自已配置文件: 1.CMD,找到安装目录,运行 firefox.exe -ProfileManager -no-remote 2.点击“start firefox" 3.在新启动的firefox中安装自已需要的配置。 参考:http://lijingshou.iteye.com/blog/2085276 使用自已的配置启动firefox:原创 2015-09-29 11:58:17 · 489 阅读 · 0 评论 -
python运行类,能够执行
test_um_test.py: importunittestfromunnecessary_math import multiply classTestUM(unittest.TestCase): defsetUp(self): pass def test_number_3_4(self): self.assertEqual(multi原创 2015-09-30 09:42:16 · 583 阅读 · 0 评论 -
python 操作 编辑器
先找到文本编辑区所在的iframe标签。 切换至iframe标签: 方法1:iframe有id 或 name driver.switch_to_frame("iframename/id") 方法2:iframe无id/name情况 frame=driver.find_element_by_xpath(" ") #切换至iframe driver.switch_to_frame(fr原创 2015-09-28 09:11:03 · 375 阅读 · 0 评论 -
AttributeError: 'WebDriver' object has no attribute
AttributeError: 'WebDriver' object has no attribute 'switch_to_defaultFrame' 如果查找不到某个对像,会很快就结束了。所以调试时,看到出错,立刻就结束的,说明找不到该对像。原创 2015-09-28 17:14:43 · 12287 阅读 · 0 评论 -
ImportError: No module named selenium
参考:http://www.xuebuyuan.com/451338.html 如果能导入selenium模块: import selenium print selenium.__file__ #打印出导入的路径 正确导入:C:\Python27\lib\site-packages\selenium-2.31.0-py2.7.egg\selenium\__init原创 2015-09-26 12:36:00 · 16242 阅读 · 1 评论 -
python保存图片
import urllib import re import sys from urllib import urlretrieve url='http://desk.zol.com.cn/bizhi/5015_62176_2.html' t=urllib.urlopen(url) s=t.read() t.close() ur='' ulist=re.findall(ur,s) file=r'原创 2015-08-20 12:00:30 · 1115 阅读 · 0 评论 -
python模拟登录
#coding utf-8 import cookielib import urllib2,re turl='http://www.test.saofang.cn/service/agent/agentManageIndex.do' purl='http://www.test.saofang.cn/pub/doAgentLogin.do' #接收post数据的url data={'us原创 2015-08-26 15:48:41 · 637 阅读 · 0 评论 -
python安装 包
win8: pip.exe install xxx pip.exe list 显示已安装的包原创 2015-12-17 14:43:38 · 325 阅读 · 0 评论