11 2021 档案

selenium.common.exceptions.JavascriptException : Message: TypeError: document.querySelector(...) is null
摘要:很大原因是页面还未加载完全,需添加等待时间 阅读全文

posted @ 2021-11-23 16:28 苦海舟 阅读(331) 评论(0) 推荐(0)

python 折行 无空格
摘要:>>> line = (... "this is a"... "very very"... "long string")>>> print(line)this is avery verylong string 阅读全文

posted @ 2021-11-23 16:27 苦海舟 阅读(40) 评论(0) 推荐(0)

selenium 切换窗口 current_url获取的地址并非切换后的窗口地址
摘要:问题:打开当前页面--1,点击按钮后重新打开窗口--2,此时执行current_url,获取到的url为窗口1的url 解决方法: switch_to.window(窗口2句柄),然后再执行current_url,就可获取窗口2的url 阅读全文

posted @ 2021-11-20 17:32 苦海舟 阅读(627) 评论(0) 推荐(0)

switch_to.active_element 获取焦点元素
摘要:https://blog.csdn.net/huilan_same/article/details/52338073 阅读全文

posted @ 2021-11-16 16:13 苦海舟 阅读(117) 评论(0) 推荐(0)

js 向iframe里的富文本框输入内容
摘要:https://exmail.qq.com document.querySelector('iframe#mainFrame').contentWindow.document.getElementsByClassName('QMEditorIfrmEditArea')[0].contentDocum 阅读全文

posted @ 2021-11-16 14:12 苦海舟 阅读(393) 评论(0) 推荐(0)

selenium 富文本框 send_keys 页面无内容
摘要:在qq企业邮箱中定位编写邮件页面的正文输入框,并向其中输入内容,定位语句(已定位到body标签)与最后的send_keys都正常执行,无报错内容,但实际页面始终没有信息输入。 后来使用js语句完成输入操作:document.querySelector('body').innerText='123'; 阅读全文

posted @ 2021-11-16 14:01 苦海舟 阅读(166) 评论(0) 推荐(0)

selenium.common.exceptions.JavascriptException: Message: SyntaxError: unexpected token: identifier
摘要:初始: string = ‘abc’ js = f"document.querySelector('body').innerText={string}"driver.execute_script(js) 执行报错: selenium.common.exceptions.JavascriptExcep 阅读全文

posted @ 2021-11-16 13:55 苦海舟 阅读(541) 评论(0) 推荐(0)

selenium.common.exceptions.InvalidElementStateException: Message: Unable to clear element that cannot be edited: <td class="content_title">
摘要:输入框,元素定位未定位到input标签 阅读全文

posted @ 2021-11-15 16:30 苦海舟 阅读(347) 评论(0) 推荐(0)

css_selector and or
摘要:选择元素X的属性a和b: X[a][b] 选择元素X的属性a或b X[a],X[b] 阅读全文

posted @ 2021-11-14 16:14 苦海舟 阅读(153) 评论(0) 推荐(0)

导航