报错

Traceback (most recent call last):
File "C:/myFiles/code/cnki/cnki_1/core/knavi.py", line 281, in <module>
main()
File "C:/myFiles/code/cnki/cnki_1/core/knavi.py", line 270, in main
periodical(driver, i["periodical_herf"])
File "C:/myFiles/code/cnki/cnki_1/core/knavi.py", line 232, in periodical
driver.get(URL) # 获取页面
File "C:\python3.6.3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get
self.execute(Command.GET, {'url': url})
File "C:\python3.6.3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\python3.6.3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 241, in check_response
raise exception_class(message, screen, stacktrace, alert_text)
selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: None
Message: unexpected alert open: {Alert text : 您点击的频率过快!请稍后再试}
(Session info: chrome=73.0.3683.103)
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.15063 x86_64)

解决方案:

from selenium.common.exceptions import UnexpectedAlertPresentException

            except UnexpectedAlertPresentException:
driver.switch_to.alert.accept()
driver.delete_all_cookies()
time.sleep(300)
continue

selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: None;Message: unexpected alert open: {Alert text : 您点击的频率过快!请稍后再试}的更多相关文章

  1. Python3+selenium 报错处理:“selenium.common.exceptions.NoAlertPresentException: Message: No alert is active”

    一.说明 在使用python3+selenium写自动升级程序的时侯,碰到一个弹出对话框需要点击确认的场景.弹出的对话框如下图所示. 对于弹框各种资料都说通过switch_to.alert属性获取对话 ...

  2. selenium.common.exceptions.ElementNotVisibleException: Message: element not visible处理方法:selenium针对下拉菜单事件的处理

    使用Selenium爬虫时,可能会遇到一些下拉菜单,动态加载,如果直接使用find_element_by_函数会报错,显示selenium.common.exceptions.ElementNotVi ...

  3. Appium问题解决方案(5)- selenium.common.exceptions.InvalidSelectorException: Message: Locator Strategy 'name' is not supported for this session

    背景 使用Appium Server 1.15.1版本 执行了以下脚本 test = driver.find_element_by_name("自动化测试") print(test ...

  4. selenium.common.exceptions.TimeoutException: Message: Screenshot: available via screen

    在使用selenium+phantomjs的时候在Windows平台下能够正常工作,在Linux下却不能,并得到错误信息: selenium.common.exceptions.TimeoutExce ...

  5. selenium使用遇到的问题(selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.)

    1.安装pip3 install selenium 2.使用browser=webdriver.Chrome()时报错 :selenium.common.exceptions.WebDriverExc ...

  6. python+selenium,打开浏览器时报selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverExcep ...

  7. 【Selenium】【BugList7】执行driver.find_element_by_id("kw").send_keys("Selenium"),报错:selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined to be a string

    [版本] selenium:3.11.0 firefox:59.0.3 (64 位) python:3.6.5 [代码] #coding=utf-8 from selenium import webd ...

  8. 关于Selenium.common.exceptions.WebDriverException: Message: Invalid locator strategy: css selector 的问题

    在执行脚本时报Selenium.common.exceptions.WebDriverException: Message: Invalid locator strategy: css selecto ...

  9. appium selenium.common.exceptions.WebDriverException: Message: Parameters were incorrect

    selenium.common.exceptions.WebDriverException: Message: Parameters were incorrect. We wanted {" ...

随机推荐

  1. 潭州课堂25班:Ph201805201 django 项目 第四十三课 后台 用户管理前后功能实现 (课堂笔记)

    用户的展示,编辑,删除, 把用户显示出来,用户名,员工(是,否), 超级用户(是, 否) 活跃状态,(非活跃示为删除) 在前台要显示该用户所属的用户组,在前台代码中是调用类的属性,所以在 user 的 ...

  2. 潭州课堂25班:Ph201805201 django 项目 第三十课 linux 系统迁移 (课堂笔记)

    进入虚拟环境, 冷冻 把安装环境放到这个文档中 pip freeze >> requirements.txt 在另一台机器中 pip install -r requirements.txt ...

  3. [Python]网络爬虫( 连载:大牛汪海 )

    汪海个人博客:http://blog.callmewhy.com/ Python爬虫专栏,汪海专栏 Python爬虫入门教程 简单的介绍如何使用Python的相关模块如urllib2来实现网络爬虫的基 ...

  4. BZOJ4081 : [Wf2014]Skiing

    首先将目标点按$y$坐标从小到大排序. 如果加速度为$0$,那么只要贪心走一遍即可. 否则考虑DP,设$f[i][j]$表示从$i$点以速度$j$出发最多能经过多少个点. 注意到将DP值相同的合并可以 ...

  5. 为什么要DevOps?

    Boss:「项目经常延期」「做东西太慢」 产品: 「老板的想法总变」 「事情太多,忙成狗」 「开发说这个实现不了」 开发: 「需求总变」 「UI 方案给的太晚」 「活儿太多」 测试: 「需求变了没提前 ...

  6. 微信公众号开发之通过获取token等信息

    <?php /** * 发送post请求 * @param string $url * @param string $param * @return bool|mixed */ function ...

  7. 经典SQL面试题(转)

    以下题目都在MySQL上测试可行,有疏漏或有更优化的解决方法的话欢迎大家提出,我会持续更新的:) 有三个表,如果学生缺考,那么在成绩表中就不存在这个学生的这门课程成绩的记录,写一段SQL语句,检索出每 ...

  8. 微信小程序中的单位

    vw:viewpoint width,视窗宽度,1vw等于视窗宽度的1%. vh:viewpoint height,视窗高度,1vh等于视窗高度的1%. rpx:rpx单位是微信小程序中css的尺寸单 ...

  9. mysql 命令语句

    1.大部分数据库命令语句 数据库的命令 net start MYsql 启动的服务 net stop mysql 关闭服务 mysql -uroot -p 输入数据库名和密码登入 show datab ...

  10. mormot支持TCP/IP

    mormot支持TCP/IP http.sys本来就构建于TCP/IP之上,因此HTTP.SYS是支持TCP/IP连接的. 笔者为此特意写了一个测试DEMO.TCP/IP连接成功. 如果客户端过一段时 ...