- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
浏览时this web site通过Chrome,它将显示所有价格
使用Python Webdriver chromedrive时,它停在中间,无法显示价格详细信息。就像下面这样:
我想念什么?
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")
base_url = "https://booking.hkexpress.com/en-US/select/?SearchType=RETURN&OriginStation=HKG&DestinationStation=KIX&DepartureDate=19/04/2019&ReturnDate=26/04/2019&Adults=1&LowFareFinderSelected=false"
driver = webdriver.Chrome(executable_path=(r'D:\My Homepages\hkexpress\chromedriver.exe'), chrome_options=chrome_options)
driver.get(base_url + '/')
pageSource = driver.page_source
print(pageSource)
driver.save_screenshot('screen.png')
driver.close()
最佳答案
看来你们已经很接近了。由于网站是基于JavaScript因此,您必须引发WebDriverWait才能使元素可见,并且您可以使用以下解决方案:
代码块:
# -*- coding: UTF-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
options.add_argument("--disable-extensions")
# options.add_argument('disable-infobars')
driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
driver.get("https://booking.hkexpress.com/en-US/select/?SearchType=RETURN&OriginStation=HKG&DestinationStation=KIX&DepartureDate=19/04/2019&ReturnDate=26/04/2019&Adults=1&LowFareFinderSelected=false")
WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//h2[@class='label' and normalize-space()='Departure']")))
print(driver.page_source)
driver.save_screenshot('./Screenshots/screen.png')
driver.quit()
控制台输出:
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head>
<script type="text/javascript" async="" src="https://www.google-analytics.com/plugins/ua/ec.js"></script><script type="text/javascript" async="" src="//avd.innity.com/dc/cb/?mt=_iampt._cbUC"></script><script type="text/javascript" async="" src="https://avd.innity.net/lib/dc.js"></script><script type="text/javascript" id="veConnect" async="" crossorigin="anonymous" src="https://confighk.veinteractive.com/scripts/5.0/capture-apps-5.0.0.js"></script><script type="text/javascript" src="https://bam.nr-data.net/1/4475d8487d?a=163005030&v=1118.0c07c19&to=MQBSZxECWRBRBUEMCQhKfWUgTGcCVwN2CggSF19fDwZFTHkIUQAe&rst=13575&ref=https://booking.hkexpress.com/en-US/select/&ap=8&be=3016&fe=12746&dc=9556&perf=%7B%22timing%22:%7B%22of%22:1553585880823,%22n%22:0,%22f%22:3,%22dn%22:526,%22dne%22:526,%22c%22:526,%22s%22:630,%22ce%22:932,%22rq%22:932,%22rp%22:1053,%22rpe%22:1413,%22dl%22:1061,%22di%22:5066,%22ds%22:9555,%22de%22:9558,%22dc%22:12746,%22l%22:12746,%22le%22:12776%7D,%22navigation%22:%7B%7D%7D&jsonp=NREUM.setToken"></script><script type="text/javascript" async="" src="https://www.googleadservices.com/pagead/conversion_async.js"></script><script src="https://js-agent.newrelic.com/nr-1118.min.js"></script><script type="text/javascript" async="" src="https://www.google-analytics.com/analytics.js"></script><script type="text/javascript" src="https://static.hkexpress.com/libs/jquery3-3-1.min.js"></script>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /><script type="text/javascript">window.NREUM||(NREUM={});NREUM.info = {"beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net","licenseKey":"4475d8487d","applicationID":"163005030","transactionName":"MQBSZxECWRBRBUEMCQhKZUEKTFINHTNmShUDCVVQF0w=","queueTime":0,"applicationTime":1,"agent":"","atts":""}</script><script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(e,n,t){function r(t){if(!n[t]){var o=n[t]={exports:{}};e[t][0].call(o.exports,function(n){var o=e[t][1][n];return r(o||n)},o,o.exports)}return n[t].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<t.length;o++)r(t[o]);return r}({1:[function(e,n,t){function r(){}function o(e,n,t){return function(){return i(e,[c.now()].concat(u(arguments)),n?null:this,t),n?void 0:this}}var i=e("handle"),a=e(3),u=e(4),f=e("ee").get("tracer"),c=e("loader"),s=NREUM;"undefined"==typeof window.newrelic&&(newrelic=s);var p=["setPageViewName","setCustomAttribute","setErrorHandler","finished","addToTrace","inlineHit","addRelease"],d="api-",l=d+"ixn-";a(p,function(e,n){s[n]=o(d+n,!0,"api")}),s.addPageAction=o(d+"addPageAction",!0),s.setCurrentRouteName=o(d+"routeName",!0),n.exports=newrelic,s.interaction=function(){return(new r).get()};var m=r.prototype={createTracer:function(e,n){var t={},r=this,o="function"==typeof n;return i(l+"tracer",[c.now(),e,t],r),function(){if(f.emit((o?"":"no-")+"fn-start",[c.now(),r,o],t),o)try{return n.apply(this,arguments)}catch(e){throw f.emit("fn-err",[arguments,this,e],t),e}finally{f.emit("fn-end",[c.now()],t)}}}};a("actionText,setName,setAttribute,save,ignore,onEnd,getContext,end,get".split(","),function(e,n){m[n]=o(l+n)}),newrelic.noticeError=function(e,n){"string"==typeof e&&(e=new Error(e)),i("err",[e,c.now(),!1,n])}},{}],2:[function(e,n,t){function r(e,n){if(!o)return!1;if(e!==o)return!1;if(!n)return!0;if(!i)return!1;for(var t=i.split("."),r=n.split("."),a=0;a<r.length;a++)if(r[a]!==t[a])return!1;return!0}var o=null,i=null,a=/Version\/(\S+)\s+Safari/;if(navigator.userAgent){var u=navigator.userAgent,f=u.match(a);f&&u.indexOf("Chrome")===-1&&u.indexOf("Chromium")===-1&&(o="Safari",i=f[1])}n.exports={agent:o,version:i,match:r}},{}],3:[function(e,n,t){function r(e,n){var t=[],r="",i=0;for(r in e)o.call(e,r)&&(t[i]=n(r,e[r]),i+=1);return t}var o=Object.prototype.hasOwnProperty;n.exports=r},{}],4:[function(e,n,t){function r(e,n,t){n||(n=0),"undefined"==typeof t&&(t=e?e.length:0);for(var r=-1,o=t-n||0,i=Array(o<0?0:o);++r<o;)i[r]=e[n+r];return i}n.exports=r},{}],5:[function(e,n,t){n.exports={exists:"undefined"!=typeof window.performance&&window.performance.timing&&"undefined"!=typeof window.performance.timing.navigationStart}},{}],ee:[function(e,n,t){function r(){}function o(e){function n(e){return e&&e instanceof r?e:e?f(e,u,i):i()}function t(t,r,o,i){if(!d.aborted||i){e&&e(t,r,o);for(var a=n(o),u=v(t),f=u.length,c=0;c<f;c++)u[c].apply(a,r);var p=s[y[t]];return p&&p.push([b,t,r,a]),a}}function l(e,n){h[e]=v(e).concat(n)}function m(e,n){var t=h[e];if(t)for(var r=0;r<t.length;r++)t[r]===n&&t.splice(r,1)}function v(e){return h[e]||[]}function g(e){return p[e]=p[e]||o(t)}function w(e,n){c(e,function(e,t){n=n||"feature",y[t]=n,n in s||(s[n]=[])})}var h={},y={},b={on:l,addEventListener:l,removeEventListener:m,emit:t,get:g,listeners:v,context:n,buffer:w,abort:a,aborted:!1};return b}function i(){return new r}function a(){(s.api||s.feature)&&(d.aborted=!0,s=d.backlog={})}var u="nr@context",f=e("gos"),c=e(3),s={},p={},d=n.exports=o();d.backlog=s},{}],gos:[function(e,n,t){function r(e,n,t){if(o.call(e,n))return e[n];var r=t();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!1}),r}catch(i){}return e[n]=r,r}var o=Object.prototype.hasOwnProperty;n.exports=r},{}],handle:[function(e,n,t){function r(e,n,t,r){o.buffer([e],r),o.emit(e,n,t)}var o=e("ee").get("handle");n.exports=r,r.ee=o},{}],id:[function(e,n,t){function r(e){var n=typeof e;return!e||"object"!==n&&"function"!==n?-1:e===window?0:a(e,i,function(){return o++})}var o=1,i="nr@id",a=e("gos");n.exports=r},{}],loader:[function(e,n,t){function r(){if(!E++){var e=x.info=NREUM.info,n=l.getElementsByTagName("script")[0];if(setTimeout(s.abort,3e4),!(e&&e.licenseKey&&e.applicationID&&n))return s.abort();c(y,function(n,t){e[n]||(e[n]=t)}),f("mark",["onload",a()+x.offset],null,"api");var t=l.createElement("script");t.src="https://"+e.agent,n.parentNode.insertBefore(t,n)}}function o(){"complete"===l.readyState&&i()}function i(){f("mark",["domContent",a()+x.offset],null,"api")}function a(){return O.exists&&performance.now?Math.round(performance.now()):(u=Math.max((new Date).getTime(),u))-x.offset}var u=(new Date).getTime(),f=e("handle"),c=e(3),s=e("ee"),p=e(2),d=window,l=d.document,m="addEventListener",v="attachEvent",g=d.XMLHttpRequest,w=g&&g.prototype;NREUM.o={ST:setTimeout,SI:d.setImmediate,CT:clearTimeout,XHR:g,REQ:d.Request,EV:d.Event,PR:d.Promise,MO:d.MutationObserver};var h=""+location,y={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-1118.min.js"},b=g&&w&&w[m]&&!/CriOS/.test(navigator.userAgent),x=n.exports={offset:u,now:a,origin:h,features:{},xhrWrappable:b,userAgent:p};e(1),l[m]?(l[m]("DOMContentLoaded",i,!1),d[m]("load",r,!1)):(l[v]("onreadystatechange",o),d[v]("onload",r)),f("mark",["firstbyte",u],null,"api");var E=0,O=e(5)},{}]},{},["loader"]);</script><script type="text/javascript">window.NREUM||(NREUM={});NREUM.info = {"beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net","licenseKey":"4475d8487d","applicationID":"163005030","transactionName":"MQBSZxECWRBRBUEMCQhKfWUgTGcCVwN2CggSF19fDwZFTHkIUQAe","queueTime":0,"applicationTime":8,"agent":"","atts":""}</script><script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(e,n,t){function r(t){if(!n[t]){var o=n[t]={exports:{}};e[t][0].call(o.exports,function(n){var o=e[t][1][n];return r(o||n)},o,o.exports)}return n[t].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<t.length;o++)r(t[o]);return r}({1:[function(e,n,t){function r(){}function o(e,n,t){return function(){return i(e,[c.now()].concat(u(arguments)),n?null:this,t),n?void 0:this}}var i=e("handle"),a=e(3),u=e(4),f=e("ee").get("tracer"),c=e("loader"),s=NREUM;"undefined"==typeof window.newrelic&&(newrelic=s);var p=["setPageViewName","setCustomAttribute","setErrorHandler","finished","addToTrace","inlineHit","addRelease"],d="api-",l=d+"ixn-";a(p,function(e,n){s[n]=o(d+n,!0,"api")}),s.addPageAction=o(d+"addPageAction",!0),s.setCurrentRouteName=o(d+"routeName",!0),n.exports=newrelic,s.interaction=function(){return(new r).get()};var m=r.prototype={createTracer:function(e,n){var t={},r=this,o="function"==typeof n;return i(l+"tracer",[c.now(),e,t],r),function(){if(f.emit((o?"":"no-")+"fn-start",[c.now(),r,o],t),o)try{return n.apply(this,arguments)}catch(e){throw f.emit("fn-err",[arguments,this,e],t),e}finally{f.emit("fn-end",[c.now()],t)}}}};a("actionText,setName,setAttribute,save,ignore,onEnd,getContext,end,get".split(","),function(e,n){m[n]=o(l+n)}),newrelic.noticeError=function(e,n){"string"==typeof e&&(e=new Error(e)),i("err",[e,c.now(),!1,n])}},{}],2:[function(e,n,t){function r(e,n){if(!o)return!1;if(e!==o)return!1;if(!n)return!0;if(!i)return!1;for(var t=i.split("."),r=n.split("."),a=0;a<r.length;a++)if(r[a]!==t[a])return!1;return!0}var o=null,i=null,a=/Version\/(\S+)\s+Safari/;if(navigator.userAgent){var u=navigator.userAgent,f=u.match(a);f&&u.indexOf("Chrome")===-1&&u.indexOf("Chromium")===-1&&(o="Safari",i=f[1])}n.exports={agent:o,version:i,match:r}},{}],3:[function(e,n,t){function r(e,n){var t=[],r="",i=0;for(r in e)o.call(e,r)&&(t[i]=n(r,e[r]),i+=1);return t}var o=Object.prototype.hasOwnProperty;n.exports=r},{}],4:[function(e,n,t){function r(e,n,t){n||(n=0),"undefined"==typeof t&&(t=e?e.length:0);for(var r=-1,o=t-n||0,i=Array(o<0?0:o);++r<o;)i[r]=e[n+r];return i}n.exports=r},{}],5:[function(e,n,t){n.exports={exists:"undefined"!=typeof window.performance&&window.performance.timing&&"undefined"!=typeof window.performance.timing.navigationStart}},{}],ee:[function(e,n,t){function r(){}function o(e){function n(e){return e&&e instanceof r?e:e?f(e,u,i):i()}function t(t,r,o,i){if(!d.aborted||i){e&&e(t,r,o);for(var a=n(o),u=v(t),f=u.length,c=0;c<f;c++)u[c].apply(a,r);var p=s[y[t]];return p&&p.push([b,t,r,a]),a}}function l(e,n){h[e]=v(e).concat(n)}function m(e,n){var t=h[e];if(t)for(var r=0;r<t.length;r++)t[r]===n&&t.splice(r,1)}function v(e){return h[e]||[]}function g(e){return p[e]=p[e]||o(t)}function w(e,n){c(e,function(e,t){n=n||"feature",y[t]=n,n in s||(s[n]=[])})}var h={},y={},b={on:l,addEventListener:l,removeEventListener:m,emit:t,get:g,listeners:v,context:n,buffer:w,abort:a,aborted:!1};return b}function i(){return new r}function a(){(s.api||s.feature)&&(d.aborted=!0,s=d.backlog={})}var u="nr@context",f=e("gos"),c=e(3),s={},p={},d=n.exports=o();d.backlog=s},{}],gos:[function(e,n,t){function r(e,n,t){if(o.call(e,n))return e[n];var r=t();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!1}),r}catch(i){}return e[n]=r,r}var o=Object.prototype.hasOwnProperty;n.exports=r},{}],handle:[function(e,n,t){function r(e,n,t,r){o.buffer([e],r),o.emit(e,n,t)}var o=e("ee").get("handle");n.exports=r,r.ee=o},{}],id:[function(e,n,t){function r(e){var n=typeof e;return!e||"object"!==n&&"function"!==n?-1:e===window?0:a(e,i,function(){return o++})}var o=1,i="nr@id",a=e("gos");n.exports=r},{}],loader:[function(e,n,t){function r(){if(!E++){var e=x.info=NREUM.info,n=l.getElementsByTagName("script")[0];if(setTimeout(s.abort,3e4),!(e&&e.licenseKey&&e.applicationID&&n))return s.abort();c(y,function(n,t){e[n]||(e[n]=t)}),f("mark",["onload",a()+x.offset],null,"api");var t=l.createElement("script");t.src="https://"+e.agent,n.parentNode.insertBefore(t,n)}}function o(){"complete"===l.readyState&&i()}function i(){f("mark",["domContent",a()+x.offset],null,"api")}function a(){return O.exists&&performance.now?Math.round(performance.now()):(u=Math.max((new Date).getTime(),u))-x.offset}var u=(new Date).getTime(),f=e("handle"),c=e(3),s=e("ee"),p=e(2),d=window,l=d.document,m="addEventListener",v="attachEvent",g=d.XMLHttpRequest,w=g&&g.prototype;NREUM.o={ST:setTimeout,SI:d.setImmediate,CT:clearTimeout,XHR:g,REQ:d.Request,EV:d.Event,PR:d.Promise,MO:d.MutationObserver};var h=""+location,y={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-1118.min.js"},b=g&&w&&w[m]&&!/CriOS/.test(navigator.userAgent),x=n.exports={offset:u,now:a,origin:h,features:{},xhrWrappable:b,userAgent:p};e(1),l[m]?(l[m]("DOMContentLoaded",i,!1),d[m]("load",r,!1)):(l[v]("onreadystatechange",o),d[v]("onload",r)),f("mark",["firstbyte",u],null,"api");var E=0,O=e(5)},{}]},{},["loader"]);</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="HK Express - Cheap Flights To & from Hong Kong | Budget Airline in Asia" />
<meta property="og:description" content="HK Express: Hong Kong's first and only low-fare airline! View and book airfare tickets in Asia, check flight schedules & flight status." />
<meta property="og:url" content="https://www.hkexpress.com" />
<meta property="og:image" content="https://static.hkexpress.com/media/1068/our-story.jpg?cropmode=percentaje&width=480" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="HK Express - Cheap Flights To & from Hong Kong | Budget Airline in Asia" />
<meta name="twitter:description" content="HK Express: Hong Kong's first and only low-fare airline! View and book airfare tickets in Asia, check flight schedules & flight status." />
<meta name="twitter:url" content="https://www.hkexpress.com" />
<meta name="twitter:image" content="https://static.hkexpress.com/media/1068/our-story.jpg?cropmode=percentaje&width=480" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<base href="/" />
<meta name="author" content="" />
<meta name="description" content="" />
<link rel="canonical" href="https://www.hkexpress.com/en-us/select/" />
<link rel="alternate" href="https://www.hkexpress.com/en-hk/select/" hreflang="en" />
<link rel="alternate" href="https://www.hkexpress.com/zh-hk/select/" hreflang="zh" />
<link rel="alternate" href="https://www.hkexpress.com/zh-cn/select/" hreflang="zh-CN" />
<link rel="alternate" href="https://www.hkexpress.com/zh-tw/select/" hreflang="zh-TW" />
<link rel="alternate" href="https://www.hkexpress.com/ja/select/" hreflang="ja" />
<link rel="alternate" href="https://www.hkexpress.com/ko/select/" hreflang="ko" />
<link rel="alternate" href="https://www.hkexpress.com/en-kh/select/" hreflang="en-kh" />
<link rel="alternate" href="https://www.hkexpress.com/en-th/select/" hreflang="en-th" />
<link rel="alternate" href="https://www.hkexpress.com/en-vn/select/" hreflang="en-vn" />
<link rel="apple-touch-icon" sizes="180x180" href="../../App_plugins/IBE/assets/imgs/favicons/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="../../App_plugins/IBE/assets/imgs/favicons/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="../../App_plugins/IBE/assets/imgs/favicons/favicon-16x16.png" />
<link rel="mask-icon" href="../../App_plugins/IBE/assets/imgs/favicons/safari-pinned-tab.svg" color="#6f2c91" />
<meta name="msapplication-TileColor" content="#6f2c91" />
<meta name="theme-color" content="#ffffff" />
<link href="../../App_Plugins/IBE/assets/styles/css-fonts/hke-fonts.css" rel="stylesheet" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<title>HK Express - Select Flights</title>
<link href="/App_Plugins/IBE/assets/styles/styles.min.css?v=My4x0d2i4IUr2jj/+TqsTQ==" rel="stylesheet" />
<!-- CDF: No CSS dependencies were declared //-->
<link href="../App_Plugins/IBE/assets/styles/css-fonts/hke-fonts.css" rel="stylesheet" />
<script src="//assets.adobedtm.com/a818c3b96cf5ac3d93bff8e5ef5a01871372ed93/satelliteLib-f14334f19adf9941b6b218fc18a82ef8be18a788.js"></script><script src="https://assets.adobedtm.com/a818c3b96cf5ac3d93bff8e5ef5a01871372ed93/scripts/satellite-5c90a73464746d320b000997.js"></script><script src="https://dev.visualwebsiteoptimizer.com/j.php?a=382740&u=https%3A%2F%2Fbooking.hkexpress.com%2Fen-US%2Fselect%2F%3FSearchType%3DRETURN%26OriginStation%3DHKG%26DestinationStation%3DKIX%26DepartureDate%3D19%2F04%2F2019%26ReturnDate%3D26%2F04%2F2019%26Adults%3D1%26LowFareFinderSelected%3Dfalse&r=0.36533003984482404"></script><script src="https://assets.adobedtm.com/a818c3b96cf5ac3d93bff8e5ef5a01871372ed93/scripts/satellite-5c88c7a764746d78ad007663.js"></script><script src="https://www.googletagmanager.com/gtag/js?id=UA-41860655-7"></script>
<script>
_satellite.pageBottomFired = true;
</script>
<script>
var page_data = {};
var isOmnitureEnabled = true;
var isGranifyEnabled = false;
</script>
关于python - 如何让Python selenium chromedriver加载网页中的所有元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55343172/
Selenium IDE、Selenium RC 和 Selenium WebDriver 有什么区别;我们可以在什么样的项目中使用它们?任何建议将不胜感激。 最佳答案 Selenium IDE 是一
我的 Selenium 服务器在远程服务器上运行。我从我的本地 PC 启动我的 Selenium 脚本,它从网站获取数据。 例如,我的 Selenium 脚本执行这段 JS 代码: JSON.stri
Selenium 中“//div[.//a[text()='SELENIUM']]”和“//div[//a[text()='SELENIUM']]”有什么区别xpath。 有人可以澄清我在 xpath
我正在创建自动冒烟测试。我读到在单元测试中使用多个断言不是一个好的做法,这条规则是否也适用于使用 selenium 的 webdriver 测试? 在我的冒烟测试中,有时我会使用 20 多个断言来验证
我在一个变量中存储了一个值,在另一个变量中存储了第二个值,现在我想将这两个数字相加。我无法做到这一点,我尝试过下面的代码,但它不起作用 store 6 w sto
Selenium 中的回车键和回车键有什么区别? This related SO answer并且提供的链接说明它们是不同的。我还注意到,在使用 Firefox 24.2 时,回车键将发送一个 HTM
以下是我遇到异常的详细信息: 当我使用以下命令启动节点时,出现如下错误: F:\SeleniumGrid\Jars>java -jar selenium-server-standalone-3.0.0
我是 的新手 Selenium 我对版本号有点困惑。 Selenium 2.0 2011年发布。我刚刚下载了 Selenium IDE Firefox 扩展,版本为 1.7.2 .是否还有 IDE 的
我正在使用 Selenium 运行Codeception 2。我可以看到 Selenium 打开了浏览器并运行了测试。然后,我从代码接收中得到一个错误,即存在失败的断言。 我知道有一个HTML文件可以
Closed. This question needs to be more focused。它当前不接受答案。 想要改善这个问题吗?更新问题,使它仅关注editing this post的一个问题。
我想关闭弹出窗口(已知的窗口名称),然后返回到原始窗口。 我该怎么办? 如果我无法获得窗口中关闭按钮的常量。那么有没有达到目标的一般行为? 最佳答案 你有没有尝试过: selenium.Close()
我正在用webdriver做一个测试机器人。我有一个场景,它单击一个按钮,打开一个新窗口,并且它通过特定的xpath搜索元素,但是有时没有这样的元素,因为可以将其禁用,并且出现此错误:org.open
我是第一次使用Selenium,对这些选项不知所措。我在Firefox中使用IDE。 当我的页面加载时,它随后通过JSONP请求获取值,并在其中填充选择中的选项。 我如何让Selenium等待选择中的
我开始使用nightwatch.js编写e2e测试,我注意到我想在目标浏览器的控制台(开发人员工具)中手动检查一些错误。但总是在我打开开发者控制台时,浏览器会自动关闭它。这是selenium还是nig
我正在尝试使用以下方式刮除Glassdoor的评论: https://github.com/MatthewChatham/glassdoor-review-scraper 但是我得到了错误并且不知道如
背景 我设置了一个Selenium Grid项目,以在两种不同的浏览器Chrome和Firefox中执行测试。我正在使用Gradle执行测试。该测试将成功执行两次,一次按预期在Chrome中执行,一次
当测试失败时,运行 selenium 测试的浏览器将关闭。这在尝试调试时没有帮助。我知道我可以在失败时选择屏幕截图,但如果没有整个上下文,这并没有帮助。在浏览器仍然可用的情况下,我可以回击并检查发生了
使用 Selenium Web 驱动程序而不是 Selenium RC 启动新的测试框架是个好主意吗?对于 Selenium Web 驱动程序,并非所有 Selenium 方法都已实现。那么使用 Se
我使用 selenium 页面对象模型来定义所有页面元素。我对元素命名所遵循的命名约定不太相信,并且感觉太长了。请对此提出建议。 @FindBy(xpath = "//tbody[@id='tabvi
有一个带有按钮的 html 页面,我的 Selenium 测试正在测试,当单击按钮时,会执行一个操作。 问题是,看起来点击发生在 javascript 执行之前 - 在处理程序绑定(bind)到页面之
我是一名优秀的程序员,十分优秀!