摘要: 因为ajax默认是异步提交,可是有时候我们会发现,本来要求请求马上出现,可是异步会导致后面突然再执行,这样就出问题了。 阅读全文
posted @ 2019-05-09 15:40 殊胜 阅读(1148) 评论(0) 推荐(0)
摘要: 1、在setting.py中新增如下配置,static为静态文件的目录,BASE_DIR为项目根目录 2、在url.py中增加配置 3、在html中引入静态文件 阅读全文
posted @ 2019-05-09 15:36 殊胜 阅读(4444) 评论(0) 推荐(0)
摘要: conn = pymysql.connect( host='127.0.0.1', port=3302, user='username', passwd='password', db=database, charset='utf8') #此处要指定charset为utf-8(一般数据库编码都是utf8或utf8mb4之类),否则读取出的中文会乱码 阅读全文
posted @ 2016-06-07 16:05 殊胜 阅读(8756) 评论(1) 推荐(1)
摘要: file = open(filename,'a',encoding='utf8')#指定写入编码为utf8,否则写入中文会乱码 阅读全文
posted @ 2016-06-07 16:03 殊胜 阅读(13560) 评论(0) 推荐(1)
摘要: editbox = driver.find_element_by_id("id") editbox.click() content = editbox.get_attribute("text") driver.keyevent(123)#光标定位到末尾 for i in range(0,len(content)): driver.keyevent(67)#backspace 阅读全文
posted @ 2016-06-07 15:56 殊胜 阅读(591) 评论(0) 推荐(0)
摘要: #在程序前加上这段代码 from selenium import webdriver options = webdriver.ChromeOptions() options.add_experimental_option("excludeSwitches",["ignore-certificate-errors"]) driver = webdriver.Chrome(chrome_option... 阅读全文
posted @ 2016-06-07 15:53 殊胜 阅读(13898) 评论(0) 推荐(1)
摘要: #调用方式roll_ele("ID","ele_id","7","up",3)#将控件分为7格,从底部倒数第二格向上滑动3格#滑动控件的方法def roll_ele(id,ele_id,size,direct,rollsize=1): """ 参数id为定位方式,eled_id为具体控件的id或xp 阅读全文
posted @ 2016-06-07 15:43 殊胜 阅读(2920) 评论(3) 推荐(0)