报错

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. phpmyadmin#1045 无法登录 MySQL 服务器

    使用lnmp安装wordpress在登录phpmyadmin数据库的时候诡异的出现了   phpmyadmin#1045 无法登录 MySQL 服务器,解决方法如下: 1 修改root的密码—不可以行 ...

  2. 潭州课堂25班:Ph201805201 django框架 第十三课 自定义404页面,auth系统中的User模型,auth系统权限管理 (课堂笔记)

    当 DEBUG=True 时,django 内部的404报错信息, 自带的报错信息, 要自定义404信息,要先把 DEBUG=False , 之后要自定义4040页面,有两种方法, 方法1,在创建40 ...

  3. C#7.0&6.0新特性 — 完整版

    C#2.0 泛型 部分类型 匿名方法 迭代器 可空类型 Getter / setter单独可访问性 方法组转换(代表) Co- and Contra-variance for delegates 静态 ...

  4. hiredis 使用 linux c++

    1.linux下如何安装hiredis 1)下载地址  https://github.com/redis/hiredis 2)编译和安装 解压后的文件夹执行 make;make install; 3) ...

  5. react-navigation 中的多tabs嵌套时内部tabs无法正常切换问题

    原因 问题应该是当用户滑动或切换时,无法判断是哪个tabs应该进行滑动切换和展示切换动画. 解决 swipeEnabled - 是否允许在标签之间进行滑动 animationEnabled - 是否在 ...

  6. python之模块2

    1.logging模块 等级 debug--->info--->warning(默认)--->error--->critical 配置两种方式: #1.congfig函数 lo ...

  7. px2rem

    vue做移动端适配,借助px2rem 插件方便的将px单位转为了rem 1.安装 npm install px2rem-loader  lib-flexible --save 2.在项目入口文件mai ...

  8. JAVA自学作业02

    JAVA自学作业02 1.什么是标识符?由哪些部分组成?常见的命名规则有哪些? 标识符是用户为变量的内存空间所定义的字符序列: 可以由字母.下划线.美元符号以及数字组成,但数字不可作为首字符.标识符不 ...

  9. 面向对象编程技术的总结和理解(c++)

    目录树 1.继承 1.1 基类成员在派生类中的访问属性 1.2继承时导致的二义性 1.3 多基继承 2.虚函数的多态 2.1虚函数的定义 2.2派生类中可以根据需要对虚函数进行重定义 2.3 虚函数的 ...

  10. Go 语言学习笔记

    1. go没有static关键字 面向对象编程中,尽量对函数进行封装,对于没有函数变量的对象,使用static关键字尤其方便. go中没有static关键字,必须每次new一个出来. type Han ...