2017-01-23 34 views
0

我想使用iframe的以下源代碼找到相對的xpath想從以下源代碼知道i框架的相對x路徑

我試圖與id= GTM-WDM67TP,但無法找到

<!DOCTYPE html> 
    <html ng-app="ssoPlatform"> 

<head> 

<meta charset="utf-8"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<!-- Page title set in pageTitle directive --> 
<title>Single Sign On</title> 
<link rel="icon" href="assets/images/favicon/innoplexus.png" type="image/png"> 
<!-- Google Tag Manager --> 
<script> 
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 
})(window,document,'script','dataLayer','GTM-WDM67TP'); 
</script> 
<!-- End Google Tag Manager --> 
<!-- vendor:css --> 
<link rel="stylesheet" href="assets/styles/vendor/animate.css"> 
<link rel="stylesheet" href="assets/styles/vendor/font-awesome.min.css"> 
<link rel="stylesheet" href="assets/styles/vendor/jquery.steps.css"> 
<link rel="stylesheet" href="assets/styles/vendor/select.min.css"> 
<link rel="stylesheet" href="assets/styles/vendor/titatoggle-dist-min.css"> 
<link rel="stylesheet" href="assets/styles/vendor/toastr.min.css"> 
<link rel="stylesheet" href="assets/styles/vendor/bootstrap/bootstrap.min.css"> 
<link rel="stylesheet" href="assets/styles/vendor/datatables/datatables.min.css"> 
<link rel="stylesheet" href="assets/styles/vendor/dropzone/basic.css"> 
<link rel="stylesheet" href="assets/styles/vendor/dropzone/dropzone.css"> 
<link rel="stylesheet" href="assets/styles/vendor/jquery-ui/jquery-ui.css"> 
<link rel="stylesheet" href="assets/styles/vendor/notify/angular-notify.min.css"> 
<!-- endinject --> 
<!-- inject:css --> 
<link rel="stylesheet" href="assets/styles/user/main.css"> 
<!-- endinject --> 
</head> 

<body class="mini-navbar"> 
<!-- Google Tag Manager (noscript) --> 
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WDM67TP" height="0" width="0" style="display:none;visibility:hidden"></iframe> </noscript> 
<!-- End Google Tag Manager (noscript) --> 
<div ui-view="mainView" ng-class=""></div>` 

回答

0

嘗試使用下面XPath

//iframe[contains(@src, "id=GTM-WDM67TP")]