Over a million developers have joined DZone.

Extracting Web Page Title

DZone's Guide to

Extracting Web Page Title

· ·
Free Resource
Easy extracting html 'title' element from an url

require 'open-uri'

URI.parse('http://google.es').open do |f|
	f.each {|l| if md = (/\s*(.*)\s*<\/title>/iu).match(l) then print md[1] end }

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}