摘要: 一、变量 (一) 声明变量 变量名 = 变量值 (二) 变量定义的规则 1、 变量名只能是字母、数字、下划线组合 2、 变量名的第一个字符不能是数字 3、 以下关键字不能声明为变量名['and', 'as', 'assert', 'break', 'class', 'continue', 'def' 阅读全文
posted @ 2018-06-25 15:18 sleeping_cat 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 一、列表 1. 定义列表: 变量 = [‘’,’’,’’,’’…….] 列表中可以包含列表,为子列表 2. 切片:取多个元素 3. 追加: 4. 插入: 5. 修改: 6. 删除: 1) 2) 3) 7. 扩展: 8. 拷贝: a) 浅copy: 浅copy,只copy第一层,下一层指向原内存地址, 阅读全文
posted @ 2018-06-25 15:15 sleeping_cat 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 算数运算: 比较运算: 赋值运算: 逻辑运算: 成员运算: 身份运算: 位运算: *按位取反运算规则(按位取反再加1) 详解http://blog.csdn.net/wenxinwukui234/article/details/42119265 运算符优先级: 三元运算: result = 值1 i 阅读全文
posted @ 2018-06-25 15:07 sleeping_cat 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 一、数字 1. int 整型 在32位机器上,整数的位数为32位,取值范围为-2**31~2**31-1,即-2147483648~2147483647 在64位系统上,整数的位数为64位,取值范围为-2**63~2**63-1,即-9223372036854775808~9223372036854 阅读全文
posted @ 2018-06-25 15:01 sleeping_cat 阅读(226) 评论(1) 推荐(0) 编辑
摘要: #!usr/bin/env python #-*- coding:utf-8 -*- #禁用Firefox浏览器中的CSS、Flash及Image加载 from selenium import webdriver import time,unittest class TestDemo(unittest.TestCase): def setUp(self): #创... 阅读全文
posted @ 2018-01-13 12:15 sleeping_cat 阅读(389) 评论(0) 推荐(0) 编辑
摘要: #!usr/bin/env python #-*- coding:utf-8 -*- #禁用Chrome浏览器中的Image加载 from selenium import webdriver import time,unittest from selenium.webdriver.chrome.options import Options class TestDemo(unittest... 阅读全文
posted @ 2018-01-13 12:14 sleeping_cat 阅读(415) 评论(0) 推荐(0) 编辑
摘要: #!usr/bin/env python #-*- coding:utf-8 -*- #启用Firefox的同时打开Firebug from selenium import webdriver from selenium.webdriver.common.keys import Keys import time,unittest class TestDemo(unittest.Test... 阅读全文
posted @ 2018-01-13 12:13 sleeping_cat 阅读(173) 评论(0) 推荐(0) 编辑
摘要: #!usr/bin/env python #-*- coding:utf-8 -*- #禁用IE的保护模式 from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import unittest,time class Tes... 阅读全文
posted @ 2018-01-13 12:11 sleeping_cat 阅读(452) 评论(0) 推荐(0) 编辑
摘要: #!usr/bin/env python #-*- coding:utf-8 -*- #禁用Chrome浏览器的PDF和Flash插件 from selenium import webdriver from selenium.webdriver.chrome.options import Options import unittest,time class TestDemo(unitt... 阅读全文
posted @ 2018-01-13 12:10 sleeping_cat 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 屏蔽WebDriver启动Chrome实例时总出现的“--ignore-certificate-errors”提示信息,同时禁用Chrome浏览器的插件,并且让浏览器窗口最大化。 #!usr/bin/env python #-*- coding:utf-8 -*- #屏蔽Chrome的--ignore-certificate-errors提示及禁用扩展插件并实现窗口最大化 from se... 阅读全文
posted @ 2018-01-13 12:07 sleeping_cat 阅读(10620) 评论(0) 推荐(0) 编辑