I'm using Selenium and Page Objects. All individual page objects extends the master Page Object. In the master Page Object, I'd like to log the pages metadata. All meta data including the name and the content. Here is what it looks like from our page source:
<meta name="description" content="This is the description content. "/>
<meta name="keyword" content="USBC, , Electronics, Computers, Appliances , Furniture & Mattresses, Tires & Auto, Floral, Gifts & Books, Jewelry, Watches & Sunglasses, Patio, Lawn & Garden, Home Improvement, Home & Kitchen, Office Products, Clothing, Luggage & Handbags, Health & Beauty, Baby, Kids & Toys, Grocery & Household, Sports & Fitness, View More Categories, Landing Pages, Pharmacy Feature Pages, Shop With Us for electronics, computers, furniture, outdoor living, appliances, jewelry and more. Enjoy low prices on name-brands products delivered to your door. "/>
Can anyone come up with a good quick, clean method to iterate through all of the meta elements logging all of the attributes and values (Mainly the "meta" elements and the text of the "title" element)?