随笔分类 -  编程强化学习

selenium xpath路径
摘要:driver.find_element_by_xpth("//*[text()=‘北京北’]") xpath写法: ("//*[text()=‘xxxxx’]") js写法: js = "$('input[id=xxx]')".removeAttr(‘readonly’)" dirver .exec 阅读全文
posted @ 2021-03-08 15:35 wenjingtester 阅读(92) 评论(0) 推荐(0)
分布式环境搭建
摘要:seleniumhq网址:https://docs.seleniumhq.org/download 点击selenium standalone server download version 3.141.59 下载java包 配置环境变量 cat /etc/profile 阅读全文
posted @ 2020-01-20 16:07 wenjingtester 阅读(116) 评论(0) 推荐(0)
requirements同步
摘要:生成命令: pip freeze > requirements.txt 自动安装命令:pip install -r requirements.txt 阅读全文
posted @ 2020-01-20 15:46 wenjingtester 阅读(85) 评论(0) 推荐(0)
python虚拟环境安装
摘要:命令:pip install virtualenvwrapper (mac/liunx) 命令:pip install virtualenvwrapper -win (window) cat /.bash_profilealias ll ='ls-alf' python3.6/bin/virtual 阅读全文
posted @ 2020-01-20 14:38 wenjingtester 阅读(89) 评论(0) 推荐(0)
css定位
摘要: 阅读全文
posted @ 2020-01-20 14:31 wenjingtester 阅读(80) 评论(0) 推荐(0)
xpath定位
摘要:XPath Helper Chrome插件 https://chromecj.com/web-development/2018-01/892.html 阅读全文
posted @ 2020-01-19 17:26 wenjingtester 阅读(112) 评论(0) 推荐(0)
规格参数代码
摘要:info_eles = driver.find_element_by_class_name('Ptable-item') result_list = [] for info_ele in info_eles: info_ele_dict = get_info_ele_dict(info_ele) r 阅读全文
posted @ 2020-01-17 16:32 wenjingtester 阅读(277) 评论(0) 推荐(0)
切换句柄
摘要:#切换句柄(2个标签)handles = driver.window_handlescurrent_handles = driver.current_window_handlefor handle in handles: if handle != current_handles: driver.sw 阅读全文
posted @ 2020-01-17 16:29 wenjingtester 阅读(319) 评论(0) 推荐(0)
dumps
摘要:1.json.dumps()用于将dict类型的数据转成str 2.json.loads():用于将str类型的数据转成dict 3.json.dump()用于将dict类型的数据转成str,并写入到json文件中 4.json.load()用于从json文件中读取数据 阅读全文
posted @ 2020-01-16 10:33 wenjingtester 阅读(653) 评论(0) 推荐(0)
parttwo
摘要:from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChainsimport time,os,jsondriver = webdriver.Chrome()url = "htt 阅读全文
posted @ 2020-01-15 15:42 wenjingtester 阅读(237) 评论(0) 推荐(0)
跳过cookies访问
摘要:from selenium import webdriverimport time,os,jsondriver = webdriver.Chrome()driver.maximize_window()url = "https://www.cnblogs.com/"driver.get(url)#保存 阅读全文
posted @ 2020-01-15 11:22 wenjingtester 阅读(251) 评论(0) 推荐(0)
js几种定位方法总结
摘要:操作滚动条: # 第一个参数横轴最左侧,10000代表最右侧;# #第二个参数代表上和下,0是代表最上边,10000代表最下边 js = "window.scrollTo(0,1500)"#操作浏览器右侧滚动条 driver.execute_script(js) 总结了几种js常用的定位元素方法,并 阅读全文
posted @ 2020-01-15 11:18 wenjingtester 阅读(7497) 评论(0) 推荐(0)
python 截图screenshot处理
摘要:from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChainsimport timeimport osdef screenshot(driver,file_path = No 阅读全文
posted @ 2020-01-14 15:13 wenjingtester 阅读(2848) 评论(0) 推荐(0)
web-based与executable区别
摘要:1.X86和X86-64的区别:系統是32 bit 的版本还是 64bit 的 2.web-based ,executable , embeddable zipfile区别 web-based: 透过网络安装的,就是执行安装后才透过网络下载python executable: 可執行文件的,既把要安 阅读全文
posted @ 2020-01-13 17:09 wenjingtester 阅读(760) 评论(0) 推荐(0)
python环境准备(2020-1-13)
摘要:python 3.6.5下载地址:https://www.python.org/downloads/release/python-365/ chromedriver下载地址:(1) npm.taobao.org/mirrors/chromedriver/ (2) sites.google.com/ 阅读全文
posted @ 2020-01-13 16:55 wenjingtester 阅读(140) 评论(0) 推荐(0)