摘要:
1、iframe切换 切换到对应的iframe标签中可以进行定位切换方法:driver.switch_to.framedriver.switch_to.frame(名称)driver.switch_to.frame(索引)driver.switch_to.frame(elements节点) driv 阅读全文
摘要:
def a(x): return x print(a) #不带括号调用的结果:<function a at 0x1091766a8> print(a(3)) #带括号调用的结果:3 1、不带括号时,调用的是这个函数本身2、带括号(此时必须传入需要的参数),调用的是函数的return结果 参考:htt 阅读全文
摘要:
报错1:__init__() takes 1 positional argument but 2 were given 原因:进入源码可以看到,alert_is_present是一个class类,因此调用的时候要加上括号alert_is_present() 报错2:TypeError: 'Alert 阅读全文
摘要:
driver = webdriver.Chrome() driver.get('https://www.12306.cn/index/') # 通过js代码修改元素的属性 from_ele = driver.find_element_by_id("fromStationText") to_ele = 阅读全文
摘要:
http://idea.medeming.com/jihuoma/ 阅读全文
摘要:
https://blog.csdn.net/ywk_hax/article/details/82633542 find_element():查找一个元素 find_elements():查找多个元素并返回一个列表 阅读全文
摘要:
1、打开pycharm的terminal,到 requirements.txt 所在的目录下,使用如下命令 ,就能在当前的 python 环境中导入所有需要的包 pip3 install -r requirements.txt 2、打开pycharm的terminal,到 requirements. 阅读全文
摘要:
写入的数据前加上str(),转成str格式 阅读全文
摘要:
import json python转为json:json.dumps(obj) json转为python:json.loads(obj) import json """ json python [] : json中的数组 列表 list {} : json中的对象 字典dict true True 阅读全文
摘要:
webservice接口:一个url下包含多个接口,返回数据为xml文档 安装模块 pip install suds-jurko from suds import client url = "https://xxxxxx" cli = client.Client(url=url) # 查看该webs 阅读全文