I am using Nokogiri to pull the <h1>
and <title>
tags,
but I am having trouble getting these:
<meta name="description" content="I design and develop websites and applications.">
<meta name="keywords" content="web designer,web developer">
I have this code:
url = 'https://en.wikipedia.org/wiki/Emma_Watson'
page = Nokogiri::HTML(open(url))
puts page.css('title')[0].text puts page.css('h1')[0].text
puts page.css('description')
puts META DESCRIPTION
puts META KEYWORDS
I looked in the docs and didn't find anything. Would I use regex to do this?
Thanks.