diff --git a/src/mechanize/page.cr b/src/mechanize/page.cr index 3b459c9..7ab77ba 100644 --- a/src/mechanize/page.cr +++ b/src/mechanize/page.cr @@ -12,7 +12,12 @@ class MechanizeCr::Page < MechanizeCr::File end def title - title = parser.css("title").first.inner_text + title_node = css("title") + if title_node.empty? + "" + else + title_node.first.inner_text + end end def forms