摘要: #coding=utf-8from selenium import webdriverimport timeimport osos.environ["webdriver.firefox.driver"]="C:\Program Files\Mozilla Firefox\firefox.exe" d 阅读全文
posted @ 2018-04-22 22:30 夏晓旭 阅读(2748) 评论(0) 推荐(0)
摘要: 方法1:cmd环境下,用pip install selenium 可能会很慢 方法2:下载selenium安装包手动安装 下载地址:https://pypi.org/project/selenium/ 选择扩展名为gz的源码包进行下载 下载后解压,cmd环境进入到setup.py文件所在目录 运行 阅读全文
posted @ 2018-04-22 21:25 夏晓旭 阅读(148484) 评论(1) 推荐(1)
摘要: 安装方法1:可以从官方网站下载:http://seleniumhq.org/download/,但是由于selenium服务器在美国,中美的网络经常不稳定,经常会连接失败,导致下载不了 可以找一下selenium IDE插件的XPI安装文件来完成安装。 安装方法2:可以用Firefox打开https 阅读全文
posted @ 2018-04-22 14:53 夏晓旭 阅读(55596) 评论(2) 推荐(2)
摘要: http://ftp.mozilla.org/pub/firefox/releases firefox版本42以上的用不了firebug,需要装版本42以下的,否则用不了 阅读全文
posted @ 2018-04-20 16:53 夏晓旭 阅读(840) 评论(0) 推荐(0)
摘要: #coding=utf-8 import osdef find_file(arg,dirname,files): #for i in arg: #print i for file in files: file_path=os.path.join(dirname,file) print 'file_p 阅读全文
posted @ 2018-04-20 14:41 夏晓旭 阅读(390) 评论(0) 推荐(0)
摘要: #coding=utf-8 import osimport time file_atime=int(os.path.getatime('d:\\a.txt'))print "file_atime:",file_atimetime_arr=time.localtime(file_atime)print 阅读全文
posted @ 2018-04-20 13:55 夏晓旭 阅读(557) 评论(0) 推荐(0)
摘要: #coding=utf-8 import osos.chdir('d:\\test2')file_list=os.listdir('.')print "file_list:",file_listprint "*"*100 for file in file_list: print os.path.sp 阅读全文
posted @ 2018-04-20 13:43 夏晓旭 阅读(593) 评论(0) 推荐(0)
摘要: excel操作 #coding=utf-8 from openpyxl import Workbook wb = Workbook() #创建文件对象 # grab the active worksheet ws = wb.active #获取第一个sheet # Data can be assig 阅读全文
posted @ 2018-04-18 13:30 夏晓旭 阅读(365) 评论(0) 推荐(0)
摘要: 复习进程知识: python:主进程,至少有一个主线程 启动一个新的子进程:Process,pool 给每一个进程设定一下执行的任务:传一个函数+函数的参数 如果是进程池:map函数:传入一个任务函数+一个序列 启动:start 多进程执行的时候:如果主进程退出了,子进程还在执行 如何让主进程等待子 阅读全文
posted @ 2018-04-18 09:50 夏晓旭 阅读(386) 评论(0) 推荐(0)
摘要: c:\Python27\Scripts>pip listDEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a f 阅读全文
posted @ 2018-04-18 09:42 夏晓旭 阅读(26783) 评论(0) 推荐(0)