Skip to content

Instantly share code, notes, and snippets.

@LightGuard
Created February 27, 2013 18:11
Show Gist options
  • Save LightGuard/5050122 to your computer and use it in GitHub Desktop.
Save LightGuard/5050122 to your computer and use it in GitHub Desktop.
hpricot vs nokogiri output
<!DOCTYPE html SYSTEM>
<html>
<head>
<meta charset="utf-8" />
<title>News and information from LightGuardjp :</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<style>
body {
padding-top: 60px;
}
</style>
<link href="/stylesheets/bootswatch.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
<script src='//html5shim.googlecode.com/svn/trunk/html5.js' type='text/javascript'></script>
<![endif]-->
<!--[if IE 7]>
<link href='//netdna.bootstrapcdn.com/font-awesome/3.0/css/font-awesome-ie7.css' rel='stylesheet' type='text/css'>
<![endif]-->
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse" style="color:black">
Menu
<i class="icon-caret-down"></i>
</a>
<div class="nav-collapse collapse">
<ul class="nav pull-right">
<li>
<a href="http://localhost:4242/">
<i class="icon-home"></i>
Home
</a>
</li>
<li>
<a class="visible-desktop" data-original-title="Nerdy, technical musings" data-placement="bottom" href="http://localhost:4242/tech" rel="tooltip">
<i class="icon-cogs"></i>
Technical Blog
</a>
<a class="hidden-desktop" href="http://localhost:4242/tech">
<i class="icon-cogs"></i>
Technical Blog
</a>
</li>
<li>
<a class="visible-desktop" data-original-title="Musings of a spiritual nature" data-placement="bottom" href="http://localhost:4242/religious" rel="tooltip">
<i class="icon-book"></i>
Religious Blog
</a>
<a class="hidden-desktop" href="http://localhost:4242/religious">
<i class="icon-book"></i>
Religious Blog
</a>
</li>
<li>
<a class="visible-desktop" data-original-title="Random things" data-placement="bottom" href="http://localhost:4242/misc" rel="tooltip">
<i class="icon-cloud"></i>
Misc Blog
</a>
<a class="hidden-desktop" href="http://localhost:4242/misc">
<i class="icon-cloud"></i>
Misc Blog
</a>
</li>
<li>
<a class="visible-desktop" data-original-title="Presentations I've given, also nerdy and technical" data-placement="bottom" href="http://localhost:4242/presentations" rel="tooltip">
<i class="icon-th-large"></i>
Presentations
</a>
<a class="hidden-desktop" href="http://localhost:4242/presentations">
<i class="icon-th-large"></i>
Presentations
</a>
</li>
<li>
<a href="http://localhost:4242/about">
<i class="icon-info-sign"></i>
About LightGuardjp
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="span12">
<h1>Welcome to my musings!</h1>
<p>
Thanks for visiting, I'm glad you found my random musings worth
visiting. Obviously, based on the navigation, some parts of the site
will be more interesting to others. Please enjoy your stay, and be
kind to others with your comments, of course if disagree that's fine,
but please be kind to your fellow visitors.
</p>
</div>
</div>
<div class="row">
<div class="span6">
<h2>What this space is</h2>
<p>
An unorganized list of my thoughts both as a software engineer working
for Red Hat Inc. and also a member of the Church of Jesus Christ of
Latter-day Saints.
</p>
<p>
There will be (hopefully) all sorts of blog posts ranging from things
dealing with Linux, Java and other programming, spiritual matters and
random posts. I will also be posting up presentations I do, which will
for the most part be technical in nature. I don't think it will expand
much past that, but you never know. It's all part of the journey.
</p>
</div>
<div class="span6">
<h2>What this space is not</h2>
<p>
An advertising space for Red Hat Inc. (my current employer) or other
companies, a fishing ground for political, technical or religious
debate. Nor is it a place for people to demean or belittle others. If I
see that happening on the comments, you will be blacklisted.
</p>
<p>
I won't be mixing topics between the different blogs, so you shouldn't
have to worry about that. There will be RSS feeds for the different blogs
if you would like to follow that way. Tags may overlap with presentations,
technical and miscellaneous posts though.
</p>
</div>
</div>
<hr />
<footer>
<small>
</small><div class="container">
<div class="row">
<div class="span6">
<i class="icon-beaker"></i>
Mixed with <a href="http://twitter.github.com/bootstrap">Bootstrap</a> & <a href="http://bootswatch.com/readable/">Bootswatch Readable</a>.
<br />
<i class="icon-fire"></i>
Baked by <a href="http://awestruct.org">Awestruct</a>.
</div>
<div class="span6">
<i class="icon-share-alt"></i>
Content under licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.
<br />
<i class="icon-flag"></i>
Fonts by <a href="http://fortawesome.github.com/Font-Awesome/">Font Awesome</a>.
</div>
</div>
<div class="row">
<div class="span9 offset3">
Code released under <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, v2.0</a>.
<br />
&#169; Copyright 2012-2013 Jason Porter.
</div>
</div>
</div>
</footer>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
$('.nav a').tooltip();
});
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>News and information from LightGuardjp :</title>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
<style>
body {
padding-top: 60px;
}
</style>
<link href='/stylesheets/bootswatch.css' rel='stylesheet' type='text/css'>
<!--[if lt IE 9]>
<script src='//html5shim.googlecode.com/svn/trunk/html5.js' type='text/javascript'></script>
<![endif]-->
<!--[if IE 7]>
<link href='//netdna.bootstrapcdn.com/font-awesome/3.0/css/font-awesome-ie7.css' rel='stylesheet' type='text/css'>
<![endif]-->
</head>
<body>
<div class='navbar navbar-fixed-top'>
<div class='navbar-inner'>
<a class='btn btn-navbar' data-target='.nav-collapse' data-toggle='collapse' style='color:black'>
Menu
<i class='icon-caret-down'></i>
</a>
<div class='nav-collapse collapse'>
<ul class='nav pull-right'>
<li>
<a href='/'>
<i class='icon-home'></i>
Home
</a>
</li>
<li>
<a class='visible-desktop' data-original-title='Nerdy, technical musings' data-placement='bottom' href='/tech' rel='tooltip'>
<i class='icon-cogs'></i>
Technical Blog
</a>
<a class='hidden-desktop' href='/tech'>
<i class='icon-cogs'></i>
Technical Blog
</a>
</li>
<li>
<a class='visible-desktop' data-original-title='Musings of a spiritual nature' data-placement='bottom' href='/religious' rel='tooltip'>
<i class='icon-book'></i>
Religious Blog
</a>
<a class='hidden-desktop' href='/religious'>
<i class='icon-book'></i>
Religious Blog
</a>
</li>
<li>
<a class='visible-desktop' data-original-title='Random things' data-placement='bottom' href='/misc' rel='tooltip'>
<i class='icon-cloud'></i>
Misc Blog
</a>
<a class='hidden-desktop' href='/misc'>
<i class='icon-cloud'></i>
Misc Blog
</a>
</li>
<li>
<a class='visible-desktop' data-original-title="Presentations I've given, also nerdy and technical" data-placement='bottom' href='/presentations' rel='tooltip'>
<i class='icon-th-large'></i>
Presentations
</a>
<a class='hidden-desktop' href='/presentations'>
<i class='icon-th-large'></i>
Presentations
</a>
</li>
<li>
<a href='/about'>
<i class='icon-info-sign'></i>
About LightGuardjp
</a>
</li>
</ul>
</div>
</div>
</div>
<div class='container'>
<div class='row'>
<div class='span12'>
<h1>Welcome to my musings!</h1>
<p>
Thanks for visiting, I'm glad you found my random musings worth
visiting. Obviously, based on the navigation, some parts of the site
will be more interesting to others. Please enjoy your stay, and be
kind to others with your comments, of course if disagree that's fine,
but please be kind to your fellow visitors.
</p>
</div>
</div>
<div class='row'>
<div class='span6'>
<h2>What this space is</h2>
<p>
An unorganized list of my thoughts both as a software engineer working
for Red Hat Inc. and also a member of the Church of Jesus Christ of
Latter-day Saints.
</p>
<p>
There will be (hopefully) all sorts of blog posts ranging from things
dealing with Linux, Java and other programming, spiritual matters and
random posts. I will also be posting up presentations I do, which will
for the most part be technical in nature. I don't think it will expand
much past that, but you never know. It's all part of the journey.
</p>
</div>
<div class='span6'>
<h2>What this space is not</h2>
<p>
An advertising space for Red Hat Inc. (my current employer) or other
companies, a fishing ground for political, technical or religious
debate. Nor is it a place for people to demean or belittle others. If I
see that happening on the comments, you will be blacklisted.
</p>
<p>
I won't be mixing topics between the different blogs, so you shouldn't
have to worry about that. There will be RSS feeds for the different blogs
if you would like to follow that way. Tags may overlap with presentations,
technical and miscellaneous posts though.
</p>
</div>
</div>
<hr>
<footer>
<small>
<div class='container'>
<div class='row'>
<div class='span6'>
<i class='icon-beaker'></i>
Mixed with <a href="http://twitter.github.com/bootstrap">Bootstrap</a> & <a href="http://bootswatch.com/readable/">Bootswatch Readable</a>.
<br>
<i class='icon-fire'></i>
Baked by <a href="http://awestruct.org">Awestruct</a>.
</div>
<div class='span6'>
<i class='icon-share-alt'></i>
Content under licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.
<br>
<i class='icon-flag'></i>
Fonts by <a href="http://fortawesome.github.com/Font-Awesome/">Font Awesome</a>.
</div>
</div>
<div class='row'>
<div class='span9 offset3'>
Code released under <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, v2.0</a>.
<br>
&#169; Copyright 2012-2013 Jason Porter.
</div>
</div>
</div>
</small>
</footer>
</div>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js' type='text/javascript'></script>
<script src='https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js' type='text/javascript'></script>
<script>
$(document).ready(function() {
$('.nav a').tooltip();
});
</script>
</body>
</html>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<title>News and information from LightGuardjp :</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<style>
<![CDATA[
body {
padding-top: 60px;
}
]]>
</style>
<link href="/stylesheets/bootswatch.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
<script src='//html5shim.googlecode.com/svn/trunk/html5.js' type='text/javascript'></script>
<![endif]-->
<!--[if IE 7]>
<link href='//netdna.bootstrapcdn.com/font-awesome/3.0/css/font-awesome-ie7.css' rel='stylesheet' type='text/css'>
<![endif]-->
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse" style="color:black">
Menu
<i class="icon-caret-down"></i>
</a>
<div class="nav-collapse collapse">
<ul class="nav pull-right"><li>
<a href="http://localhost:4242/">
<i class="icon-home"></i>
Home
</a>
</li>
<li>
<a class="visible-desktop" data-original-title="Nerdy, technical musings" data-placement="bottom" href="http://localhost:4242/tech" rel="tooltip">
<i class="icon-cogs"></i>
Technical Blog
</a>
<a class="hidden-desktop" href="http://localhost:4242/tech">
<i class="icon-cogs"></i>
Technical Blog
</a>
</li>
<li>
<a class="visible-desktop" data-original-title="Musings of a spiritual nature" data-placement="bottom" href="http://localhost:4242/religious" rel="tooltip">
<i class="icon-book"></i>
Religious Blog
</a>
<a class="hidden-desktop" href="http://localhost:4242/religious">
<i class="icon-book"></i>
Religious Blog
</a>
</li>
<li>
<a class="visible-desktop" data-original-title="Random things" data-placement="bottom" href="http://localhost:4242/misc" rel="tooltip">
<i class="icon-cloud"></i>
Misc Blog
</a>
<a class="hidden-desktop" href="http://localhost:4242/misc">
<i class="icon-cloud"></i>
Misc Blog
</a>
</li>
<li>
<a class="visible-desktop" data-original-title="Presentations I've given, also nerdy and technical" data-placement="bottom" href="http://localhost:4242/presentations" rel="tooltip">
<i class="icon-th-large"></i>
Presentations
</a>
<a class="hidden-desktop" href="http://localhost:4242/presentations">
<i class="icon-th-large"></i>
Presentations
</a>
</li>
<li>
<a href="http://localhost:4242/about">
<i class="icon-info-sign"></i>
About LightGuardjp
</a>
</li>
</ul></div>
</div>
</div>
<div class="container">
<div class="row">
<div class="span12">
<h1>Welcome to my musings!</h1>
<p>
Thanks for visiting, I'm glad you found my random musings worth
visiting. Obviously, based on the navigation, some parts of the site
will be more interesting to others. Please enjoy your stay, and be
kind to others with your comments, of course if disagree that's fine,
but please be kind to your fellow visitors.
</p>
</div>
</div>
<div class="row">
<div class="span6">
<h2>What this space is</h2>
<p>
An unorganized list of my thoughts both as a software engineer working
for Red Hat Inc. and also a member of the Church of Jesus Christ of
Latter-day Saints.
</p>
<p>
There will be (hopefully) all sorts of blog posts ranging from things
dealing with Linux, Java and other programming, spiritual matters and
random posts. I will also be posting up presentations I do, which will
for the most part be technical in nature. I don't think it will expand
much past that, but you never know. It's all part of the journey.
</p>
</div>
<div class="span6">
<h2>What this space is not</h2>
<p>
An advertising space for Red Hat Inc. (my current employer) or other
companies, a fishing ground for political, technical or religious
debate. Nor is it a place for people to demean or belittle others. If I
see that happening on the comments, you will be blacklisted.
</p>
<p>
I won't be mixing topics between the different blogs, so you shouldn't
have to worry about that. There will be RSS feeds for the different blogs
if you would like to follow that way. Tags may overlap with presentations,
technical and miscellaneous posts though.
</p>
</div>
</div>
<hr /><footer><small>
<div class="container">
<div class="row">
<div class="span6">
<i class="icon-beaker"></i>
Mixed with <a href="http://twitter.github.com/bootstrap">Bootstrap</a> &amp; <a href="http://bootswatch.com/readable/">Bootswatch Readable</a>.
<br /><i class="icon-fire"></i>
Baked by <a href="http://awestruct.org">Awestruct</a>.
</div>
<div class="span6">
<i class="icon-share-alt"></i>
Content under licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.
<br /><i class="icon-flag"></i>
Fonts by <a href="http://fortawesome.github.com/Font-Awesome/">Font Awesome</a>.
</div>
</div>
<div class="row">
<div class="span9 offset3">
Code released under <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, v2.0</a>.
<br />
© Copyright 2012-2013 Jason Porter.
</div>
</div>
</div>
</small>
</footer></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script><script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js" type="text/javascript"></script><script><![CDATA[
$(document).ready(function() {
$('.nav a').tooltip();
});
]]></script></body>
</html>
====
1:1,2c
<!DOCTYPE html SYSTEM>
<html>
2:1,2c
<!DOCTYPE html>
<html>
3:1,2c
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
====
1:4c
<meta charset="utf-8" />
2:4c
<meta charset='utf-8'>
3:4,5c
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
====2
1:6c
3:7c
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
2:6c
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
====3
1:7a
2:7a
3:9c
<![CDATA[
====3
1:10a
2:10a
3:13c
]]>
====
1:12,13c
<link href="/stylesheets/bootswatch.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
2:12,13c
<link href='/stylesheets/bootswatch.css' rel='stylesheet' type='text/css'>
<!--[if lt IE 9]>
3:15,16c
<link href="/stylesheets/bootswatch.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
====3
1:16c
2:16c
<!--[if IE 7]>
3:19c
<!--[if IE 7]>
====2
1:21,23c
3:24,26c
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse" style="color:black">
2:21,23c
<div class='navbar navbar-fixed-top'>
<div class='navbar-inner'>
<a class='btn btn-navbar' data-target='.nav-collapse' data-toggle='collapse' style='color:black'>
====2
1:25c
3:28c
<i class="icon-caret-down"></i>
2:25c
<i class='icon-caret-down'></i>
====
1:27,31c
<div class="nav-collapse collapse">
<ul class="nav pull-right">
<li>
<a href="http://localhost:4242/">
<i class="icon-home"></i>
2:27,31c
<div class='nav-collapse collapse'>
<ul class='nav pull-right'>
<li>
<a href='/'>
<i class='icon-home'></i>
3:30,33c
<div class="nav-collapse collapse">
<ul class="nav pull-right"><li>
<a href="http://localhost:4242/">
<i class="icon-home"></i>
====2
1:36,37c
3:38,39c
<a class="visible-desktop" data-original-title="Nerdy, technical musings" data-placement="bottom" href="http://localhost:4242/tech" rel="tooltip">
<i class="icon-cogs"></i>
2:36,37c
<a class='visible-desktop' data-original-title='Nerdy, technical musings' data-placement='bottom' href='/tech' rel='tooltip'>
<i class='icon-cogs'></i>
====2
1:40,41c
3:42,43c
<a class="hidden-desktop" href="http://localhost:4242/tech">
<i class="icon-cogs"></i>
2:40,41c
<a class='hidden-desktop' href='/tech'>
<i class='icon-cogs'></i>
====2
1:46,47c
3:48,49c
<a class="visible-desktop" data-original-title="Musings of a spiritual nature" data-placement="bottom" href="http://localhost:4242/religious" rel="tooltip">
<i class="icon-book"></i>
2:46,47c
<a class='visible-desktop' data-original-title='Musings of a spiritual nature' data-placement='bottom' href='/religious' rel='tooltip'>
<i class='icon-book'></i>
====2
1:50,51c
3:52,53c
<a class="hidden-desktop" href="http://localhost:4242/religious">
<i class="icon-book"></i>
2:50,51c
<a class='hidden-desktop' href='/religious'>
<i class='icon-book'></i>
====2
1:56,57c
3:58,59c
<a class="visible-desktop" data-original-title="Random things" data-placement="bottom" href="http://localhost:4242/misc" rel="tooltip">
<i class="icon-cloud"></i>
2:56,57c
<a class='visible-desktop' data-original-title='Random things' data-placement='bottom' href='/misc' rel='tooltip'>
<i class='icon-cloud'></i>
====2
1:60,61c
3:62,63c
<a class="hidden-desktop" href="http://localhost:4242/misc">
<i class="icon-cloud"></i>
2:60,61c
<a class='hidden-desktop' href='/misc'>
<i class='icon-cloud'></i>
====2
1:66,67c
3:68,69c
<a class="visible-desktop" data-original-title="Presentations I've given, also nerdy and technical" data-placement="bottom" href="http://localhost:4242/presentations" rel="tooltip">
<i class="icon-th-large"></i>
2:66,67c
<a class='visible-desktop' data-original-title="Presentations I've given, also nerdy and technical" data-placement='bottom' href='/presentations' rel='tooltip'>
<i class='icon-th-large'></i>
====2
1:70,71c
3:72,73c
<a class="hidden-desktop" href="http://localhost:4242/presentations">
<i class="icon-th-large"></i>
2:70,71c
<a class='hidden-desktop' href='/presentations'>
<i class='icon-th-large'></i>
====2
1:76,77c
3:78,79c
<a href="http://localhost:4242/about">
<i class="icon-info-sign"></i>
2:76,77c
<a href='/about'>
<i class='icon-info-sign'></i>
====3
1:81,82c
2:81,82c
</ul>
</div>
3:83c
</ul></div>
====2
1:85,87c
3:86,88c
<div class="container">
<div class="row">
<div class="span12">
2:85,87c
<div class='container'>
<div class='row'>
<div class='span12'>
====2
1:98,99c
3:99,100c
<div class="row">
<div class="span6">
2:98,99c
<div class='row'>
<div class='span6'>
====2
1:114c
3:115c
<div class="span6">
2:114c
<div class='span6'>
====
1:130,139c
<hr />
<footer>
<small>
</small><div class="container">
<div class="row">
<div class="span6">
<i class="icon-beaker"></i>
Mixed with <a href="http://twitter.github.com/bootstrap">Bootstrap</a> & <a href="http://bootswatch.com/readable/">Bootswatch Readable</a>.
<br />
<i class="icon-fire"></i>
2:130,139c
<hr>
<footer>
<small>
<div class='container'>
<div class='row'>
<div class='span6'>
<i class='icon-beaker'></i>
Mixed with <a href="http://twitter.github.com/bootstrap">Bootstrap</a> & <a href="http://bootswatch.com/readable/">Bootswatch Readable</a>.
<br>
<i class='icon-fire'></i>
3:131,137c
<hr /><footer><small>
<div class="container">
<div class="row">
<div class="span6">
<i class="icon-beaker"></i>
Mixed with <a href="http://twitter.github.com/bootstrap">Bootstrap</a> &amp; <a href="http://bootswatch.com/readable/">Bootswatch Readable</a>.
<br /><i class="icon-fire"></i>
====2
1:142,143c
3:140,141c
<div class="span6">
<i class="icon-share-alt"></i>
2:142,143c
<div class='span6'>
<i class='icon-share-alt'></i>
====
1:145,146c
<br />
<i class="icon-flag"></i>
2:145,146c
<br>
<i class='icon-flag'></i>
3:143c
<br /><i class="icon-flag"></i>
====2
1:150,151c
3:147,148c
<div class="row">
<div class="span9 offset3">
2:150,151c
<div class='row'>
<div class='span9 offset3'>
====
1:153,154c
<br />
&#169; Copyright 2012-2013 Jason Porter.
2:153,154c
<br>
&#169; Copyright 2012-2013 Jason Porter.
3:150,151c
<br />
© Copyright 2012-2013 Jason Porter.
====
1:158,163c
</footer>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js" type="text/javascript"></script>
<script>
2:158,163c
</small>
</footer>
</div>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js' type='text/javascript'></script>
<script src='https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js' type='text/javascript'></script>
<script>
3:155,157c
</small>
</footer></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script><script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js" type="text/javascript"></script><script><![CDATA[
====3
1:167,168c
2:167,168c
</script>
</body>
3:161c
]]></script></body>
require 'hpricot'
require 'nokogiri'
hpricot_doc = File.open('/tmp/parser_test/index.html') { |f| Hpricot(f) }
hpricot_doc.search("//a").each { |node| node['href'] = "http://localhost:4242#{node['href']}" if node['href'] =~ /^\// }
File.open('/tmp/parser_test/hpricot_index.html', 'w') { |f| f.write hpricot_doc.to_s }
nokogiri_doc = Nokogiri::HTML(File.open('/tmp/parser_test/index.html'))
nokogiri_doc.css('a').each { |node| node['href'] = "http://localhost:4242#{node['href']}" if node['href'] =~ /^\// }
File.open('/tmp/parser_test/nokogiri_index.html', 'w') { |f| f.write nokogiri_doc.to_xhtml }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment