selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: An invalid or illegal selector was specified (Session info: chrome=78.0.3904.108) 无效选择异常 无效选择器:指定了无效或非法的选择器…
背景 使用Appium Server 1.15.1版本 执行了以下脚本 test = driver.find_element_by_name("自动化测试") print(test.text) 报了以下错误 圈重点 selenium.common.exceptions.InvalidSelectorException: Message: Locator Strategy 'name' is not supported for this session 简译:  by_name 这种定位…
报错信息:selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Compound class names not permitted 解决方法:使用其它的定位方法,这个问题是由于定位的classname名称不规范导致…
出现问题: 使用代码点击提交按钮: driver.find_element(By.CSS_SELECTOR,"#submit").click() 出现如下异常: selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <\button type="submit" id="submit" c…
当使用class定位元素时发现报错: 错误信息:selenium.common.exceptions.InvalidSelectorException: Message: Compound class names not permitted(复合类的名称不允许) 网上查询资料得知: className不允许使用复合类名做参数[原文] 真实环境中元素往往使用复合类名(即多个class用空格分隔),使用className定位时要注意了,className的参数只能是一个class. 例如图中显示的c…
[版本] selenium:3.11.0 firefox:59.0.3 (64 位) python:3.6.5 [代码] #coding=utf-8 from selenium import webdriver driver = webdriver.Firefox() driver.get("http://www.baidu.com") driver.find_element_by_id("kw").send_keys("Selenium") d…
如何解决错误[selenium.common.exceptions.SessionNotCreatedException]   [问题起因] 2018年12月26日晚,启动我的pycharm准备学习selenium相关的知识,结果报错了:selenium.common.exceptions.SessionNotCreatedException:   Message: Unable to find a matching set of capabilities 开始我很疑惑,因为早一段时间,火狐浏览…
初次用IE浏览器运行自动化程序时,报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled…
近来准备写个脚本去搜索某端游的官网交易平台.因为也不懂高端的爬虫技术,决定用selenium去戳.这里采用的是chrome浏览器,链接网页时报错: File "C:\Python37\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__ self.service.start() File "C:\Python37\lib\site-packages\selenium\we…
通过昨天的分析,我们已经能到依次打开多个页面了,接下来就是获取每个页面上宝贝的信息了. 分析页面宝贝信息 [插入图片,宝贝信息各项内容] 从图片上看,每个宝贝有如下信息:price,title,url,deal amount,shop,location等6个信息,其中url表示宝贝的地址. 我们通过查看器分析,每个宝贝都在一个div里面,这个div的class属性包含item. 而所有的item都在一个div内,这个总的div具有class属性为items,也就是单个页面上包含所有宝贝的一个框架…
作为全民购物网站的淘宝是在学习爬虫过程中不可避免要打交道的一个网站,而是淘宝上的数据真的很多,只要我们指定关键字,将会出现成千上万条数据. 今天我们来讲一下如何从淘宝上获取某一类宝贝的信息,比如今天我们以"手机"作为关键词,举个例子. 分析页面的源代码 [插入图片,淘宝手机页面示意] 上面是搜索框,下面显示了很多宝贝信息,最下面是翻页的控制按钮. [插入图片,淘宝手机页面源代码] 我们看一下这个页面的源代码,发现都是一些js,还提示了要运行脚本才能显示. 难道宝贝也是Ajax加载的?我…
运行appium脚本时报错selenium.common.exceptions.WebDriverException...,如下截图: 该报错说明appium和app的内置chrome版本不一致 [解决]手机下载安装对应版本chromedriver即可解决,下载配置如下:(仅android) 一.查看手机自带webview版本 1,查看andriod内置webview版本 方法一:手机上设置中查看 设置-->应用程序管理-->全部-->Android System WebView 方法二…
在使用selenium+phantomjs的时候在Windows平台下能够正常工作,在Linux下却不能,并得到错误信息: selenium.common.exceptions.TimeoutException: Message: Screenshot: available via screen 在ST上找到答案:http://stackoverflow.com/a/36159299/4447404 driver = webdriver.PhantomJS(service_args=['--ig…
[SPOJ]Longest Common Substring II (后缀自动机) 题面 Vjudge 题意:求若干个串的最长公共子串 题解 对于某一个串构建\(SAM\) 每个串依次进行匹配 同时记录\(f[i]\)表示走到了\(i\)节点 能够匹配上的最长公共子串的长度 当然,每个串的\(f[i]\)可以更新\(f[i.parent]\) 所以需要拓扑排序 对于每个串求出每个节点的最长匹配 然后对他们取\(min\),表示某个节点大家都能匹配的最长长度 最后对于所有点的值都取个\(max\)…
[SPOJ]Longest Common Substring(后缀自动机) 题面 Vjudge 题意:求两个串的最长公共子串 题解 \(SA\)的做法很简单 不再赘述 对于一个串构建\(SAM\) 另外一个串在\(SAM\)上不断匹配 最后计算答案就好了 匹配方法: 如果\(trans(s,c)\)存在 直接沿着\(trans\)走就行,同时\(cnt++\) 否则沿着\(parent\)往上跳 如果存在\(trans(now,c),cnt=now.longest+1\) 否则,如果不存在可行的…
从源码中可以找到selenium 2.48.0支持的浏览器如下: [python] view plain copy Firefox Chrome ChromeOptions Ie Edge Opera Safari BlackBerry PhantomJS Android Remote DesiredCapabilities ActionChains TouchActions 一.安装与配置   以笔者用的Chrome为例: 1.安装selenium 命令行运行: pip install sel…
1.安装pip3 install selenium 2.使用browser=webdriver.Chrome()时报错 :selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home 解决方法如下: 1.查看自己chr…
有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH>,下载对应版本的驱动,放至chrome的安装目录的application下面,但是还一直报相同的错误(印象中一年之前遇到相同的问题不是这么处理的,但是记不起来),查了一些blog,找…
在执行脚本时报Selenium.common.exceptions.WebDriverException: Message: Invalid locator strategy: css selector 的错 出现这个问题时请先检查你的selenium版本是否和Appium-Python-Client 的版本互相兼容 如果你的selenium是3.4的版本,需要下载 Appium-Python-Client 2.8的版本 如果selenium是2.53.6的请一定要下载 Appium-Pytho…
selenium.common.exceptions.WebDriverException: Message: Parameters were incorrect. We wanted {"required":["desiredCapabilities"],"optional":["requiredCapabilities","sessionId","id","sessionI…
报错 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&q…
使用Chrome浏览器时,经常会遇到以下报错:浏览器没有调用起来 selenium.common.exceptions.WebDriverException: Message: unknown Error: cannot find Chrome binary 通常由两种问题引起的: 1.ChromeDriver.exe驱动有问题(包括版本,路径等等) 2.Chrome.exe本身有问题. 解决方案:三个 1.指定chromedriver.exe驱动绝对路径 driver = webdriver.…
使用Selenium爬虫时,可能会遇到一些下拉菜单,动态加载,如果直接使用find_element_by_函数会报错,显示selenium.common.exceptions.ElementNotVisibleException: Message: element not visible. 意思是element是不可见的.所以无法获取到.这时候就遇到一个难题,怎么把element变成可见的呢? 这时候,我们就用ActionChains来模拟效果 ActionChains(driver).clic…
1.查看安装的chrome浏览器版本 2.查看版本对应的驱动 https://sites.google.com/a/chromium.org/chromedriver/downloads 下载后拷贝到/usr/local/bin/目录下 结果在运行程序的时候右报错:selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH 后来网上查下修改如下代码: c…
问题 :执行程序代码报错: WebDriverException:Message:'geckodriver'executable needs to be in Path 或者 selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 原因:因为firefox4.8以上的版本都需要第三方geckodriver来驱动firefox,如果是firefox4.…
首次使用selenium webdriver,webdriver.Firefox() 报错selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.  原因是没有将浏览器驱动加入系统环境变量path. Windows处理方法: 1.下载geckodriver.exe: 下载地址:https://github.com/mozilla/geckodriver…
[题解]Greatest Common Increasing Subsequence vj 唉,把自己当做DP入门选手来总结这道题吧,我DP实在太差了 首先是设置状态的技巧,设置状态主要就是要补充不漏并且适合转移. 这样的区间对区间有个设置状态的技巧:一维钦定一维区间 具体来说,是这个意思: 我们要方便记录状态 ,所以我们记录一维区间的答案 我们要可以转移,所以我们钦定一个状态方便转移 我们要方案互斥,所以我们钦定一个状态方便转移(方法同上,钦定这个技巧同时满足了两种要求) 接下来是对于方案的记…
Python2.7 selenium3.4.1在使用chrome driver时报错:selenium.common.exceptions.WebDriverException: Message: u'unknown error: cannot get automation extension\nfrom unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_gen…
滑动解锁一直做UI自动化的难点之一,我补一篇滑动解锁的例子,希望能给初做Web UI自动化测试的同学一些思路. 首先先看个例子. https://www.helloweba.com/demo/2017/unlock/ 当我手动点击滑块时,改变的只是样式: 1.slide-to-unlock-handle 表示滑块,滑块的左边距在变大(因为它在向右移动嘛!) 2.Slide-tounlock-progress 表示滑过之后的背景黄色,黄色的宽度在增加,因为滑动经过的地方都变黄了. 除些之外,没其它…
在用robotframework编写移动端测试用例(用chrome浏览器模拟手机浏览器),执行用例时, 报错selenium.common.exceptions.WebDriverException: Message: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfe…