0
我正在嘗試驗證我們網站中的打開圖形元標記&。下面是HTML代碼:如何檢索使用HP UFT或Selenium Webriver的打開圖形
<div class="atg_store_applicationResourceContainer">
</div>
<meta name="robots" content="index, follow" />
<!-- Coming inside regular metadetails-->
<!-- contentKey = -->
<!-- SEOTagID - **** -->
<title>Sectional Living Rooms </title>
<meta name="description" content="Find Sectional Living Rooms&nbsp; that will look great in your home and complement the rest of your furniture." />
<meta name="author" content="EXAMPLE.com" />
<meta name="google-site-verification" content="UscxdOsY5bXX9hk_Y0GILMPvzsL66vDcHHwkZZ7Gxpg" />
<meta property="og:title" content="Sectional Living Rooms "/>
<meta property="og:site_name" content="EXAMPLE"/>
<!-- requestSocialUrl = http://www.example.com/cartridges/PageSlot/PageSlot.jsp -->
<!-- customCanonical = http://www.example.com/furniture/Living-Rooms/Sectional-Living-Rooms/_/N-8wh -->
<link rel="canonical" href="http://www.example.com/furniture/Living-Rooms/Sectional-Living-Rooms/_/N-8wh" /> <!-- add + instead of space in words for SEO -->
<meta property="og:image" content="http:/images/unavailable.gif?$PDP_Cart_Primary_150x150$" />
<meta property="og:type" content="product"/>
<meta property="og:url" content="http://www.example.com/furniture/Living-Rooms/Sectional-Living-Rooms/_/N-8wh"/>
<meta property="og:description" content="Find Sectional Living Rooms&nbsp; that will look great in your home and complement the rest of your furniture.&nbsp;#iSofa #abc"/>
<script>var _adblock=true;</script>
我試圖從具有property
屬性值og:title
& og:description
meta
標籤得到了content
屬性的值。任何幫助都會有所幫助。
我能找到獲得與名稱元的內容,但我不能因爲標籤不具有名稱
我們同時使用UFT &硒的webdriver得到的<og:title>
& <og:description>
內容(使用Java)。所以我可以使用任何單一的幫助。
致謝
getAttribute()
方法對您有所幫助。有效 – Rohit