Running examples in 'htmltidy-Ex.R' failed
The error most likely occurred in:

> ### Name: tidy_html.response
> ### Title: Tidy or "Pretty Print" HTML/XHTML Documents
> ### Aliases: tidy_html tidy_html.HTMLInternalDocument tidy_html.character
> ###   tidy_html.connection tidy_html.default tidy_html.raw
> ###   tidy_html.response tidy_html.xml_document
> 
> ### ** Examples
> 
> opts <- list(
+   TidyDocType="html5",
+   TidyMakeClean=TRUE,
+   TidyHideComments=TRUE,
+   TidyIndentContent=TRUE,
+   TidyWrapLen=200
+ )
> 
> txt <- paste0(
+   c("<html><head><style>p { color: red; }</style><body><!-- ===== body ====== -->",
+ "<p>Test</p></body><!--Default Zone --> <!--Default Zone End--></html>"),
+   collapse="")
> 
> cat(tidy_html(txt, option=opts))
<!DOCTYPE html>
<html>
  <head>
    <meta name="generator" content="HTML Tidy for HTML5 for R version 5.0.0">
    <style>
    p { color: red; }
    </style>
    <title></title>
  </head>
  <body>
    <p>
      Test
    </p>
  </body>
</html>
> 
> library(httr)
> res <- GET("http://rud.is/test/untidy.html")
> 
> # look at the original, un-tidy source
> cat(content(res, as="text", encoding="UTF-8"))
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#4575b4"/>
<!-- meta name="viewport" content="user-scalable=false" / -->
<meta name="wot-verification" content="682597b61c21873545ca"/>
<meta name="google-site-verification" content="ltsLJXWktlxKHpTw8xKoHsF2MnAjV9o7O0FmtGk1c_Y" />
<title>rud.is</title>
<link rel="shortcut icon" href="http://rud.is/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="icon" href="http://rud.is/favicon.ico" type="image/gif" />
<link rel='index' title='rud.is' href='http://rud.is/' />
<script src="https://use.typekit.net/mkn8iiw.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script>
<link rel="stylesheet" href="style.css" type="text/css" />
<meta name="description" content="You are in a maze of twisty little passages" /> 
</head>
<body>
<div id="main">
<b>Welcome to rud.is.</b><br/>
<br/>
&gt; <i>You are in a maze of twisty little passages.</i><br/>
<br/>
Possible directions are:<br/>
<ul>
<li><a href="http://amazon.com/author/hrbrmstr">My Amazon Author Page</a></li>
<li><a href="http://rud.is/outage">Live Maine Power Outage Map (D3)</a></li>
<li><a href="http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KMEBERWI7">KMEBERWI7</a> (The wx station is back up!)</li>
<li><a href="http://rud.is/cod/">Cod: The Fish That Changed History</a> (Jarrod's 2016 entry into NHD competition)</li> 
<li><a href="http://rud.is/khan/">Genghis Khan: Rise of an Empire</a> (Jarrod's 2015 entry into NHD competition)</li> 
<li><a href="http://l.rud.is/11VkkUk">2013 Bahrain eGov "Risk Reality" talk</a></li>
<li><a href="/a/">About me</a><br/></li>
<li><a href="/b/">rud.is Blog</a><br/></li>
<li><a href="https://github.com/hrbrmstr">github repository</a><br/></li>
<li><a href="http://orcid.org/0000-0001-5670-2640">ORCID</a><br/></li>
<li><a href="http://researcherid.com/rid/I-8471-2015">ResearcherID</a><br/></li>
<li><a href="http://scholar.google.com/citations?user=bob@rudis.net">Google Scholar</a><br/></li>
<li><a href="gpgkey.txt">GPG public key</a>
<li><a href="http://flickr.com/hrbrmstr">Flickr pix</a>
<li><a href="https://foursquare.com/hrbrmstr">Foursquare history</a>
<li><a href="/f/">#nom</a> (semi-dormant food/cooking blog)<br/></li>
<li><a href="http://l.rud.is/">rud.is URL Shortener</a> (via bit.ly)</li> 
<li><a href="http://rud.is/speedtest/mini/">My speed test</a></li>
<li><a href="http://twitter.com/hrbrmstr_wx">My weather station</a></li>
</ul>
<div id="footer">
Copyright &copy; 2016, boB Rudis (<a href="http://twitter.com/hrbrmstr">@hrbrmstr</a>)
</div>
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["setCookieDomain", "*.rud.is"]);
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://rud.is/piwik/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "2"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->
</body>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-79740-5']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

<a href="http://rud.is/taxationarray.php"><!-- pain --></a>
<a href="http://preview.rudis.net/core/app/validate.php"><!-- site validation --></a>
<a href="http://canarytokens.com/static/about/traffic/tags/1uk1j7rdqtsjbbtghffnajy9c/contact.php"><!-- public data sources --></a>
</html>
> 
> # see the tidied version
> cat(tidy_html(content(res, as="text", encoding="UTF-8"),
+               list(TidyDocType="html5", TidyWrapLen=200)))
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for HTML5 for R version 5.0.0" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#4575b4" /><!-- meta name="viewport" content="user-scalable=false" / -->
<meta name="wot-verification" content="682597b61c21873545ca" />
<meta name="google-site-verification" content="ltsLJXWktlxKHpTw8xKoHsF2MnAjV9o7O0FmtGk1c_Y" />
<title>rud.is</title>
<link rel="shortcut icon" href="http://rud.is/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="icon" href="http://rud.is/favicon.ico" type="image/gif" />
<link rel='index' title='rud.is' href='http://rud.is/' />
<script src="https://use.typekit.net/mkn8iiw.js">
</script>
<script>
<![CDATA[
try{Typekit.load({ async: true });}catch(e){}
]]>
</script>
<link rel="stylesheet" href="style.css" type="text/css" />
<meta name="description" content="You are in a maze of twisty little passages" />
</head>
<body>
<div id="main"><b>Welcome to rud.is.</b><br />
<br />
&gt; <i>You are in a maze of twisty little passages.</i><br />
<br />
Possible directions are:<br />
<ul>
<li><a href="http://amazon.com/author/hrbrmstr">My Amazon Author Page</a></li>
<li><a href="http://rud.is/outage">Live Maine Power Outage Map (D3)</a></li>
<li><a href="http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KMEBERWI7">KMEBERWI7</a> (The wx station is back up!)</li>
<li><a href="http://rud.is/cod/">Cod: The Fish That Changed History</a> (Jarrod's 2016 entry into NHD competition)</li>
<li><a href="http://rud.is/khan/">Genghis Khan: Rise of an Empire</a> (Jarrod's 2015 entry into NHD competition)</li>
<li><a href="http://l.rud.is/11VkkUk">2013 Bahrain eGov "Risk Reality" talk</a></li>
<li><a href="/a/">About me</a><br /></li>
<li><a href="/b/">rud.is Blog</a><br /></li>
<li><a href="https://github.com/hrbrmstr">github repository</a><br /></li>
<li><a href="http://orcid.org/0000-0001-5670-2640">ORCID</a><br /></li>
<li><a href="http://researcherid.com/rid/I-8471-2015">ResearcherID</a><br /></li>
<li><a href="http://scholar.google.com/citations?user=bob@rudis.net">Google Scholar</a><br /></li>
<li><a href="gpgkey.txt">GPG public key</a></li>
<li><a href="http://flickr.com/hrbrmstr">Flickr pix</a></li>
<li><a href="https://foursquare.com/hrbrmstr">Foursquare history</a></li>
<li><a href="/f/">#nom</a> (semi-dormant food/cooking blog)<br /></li>
<li><a href="http://l.rud.is/">rud.is URL Shortener</a> (via bit.ly)</li>
<li><a href="http://rud.is/speedtest/mini/">My speed test</a></li>
<li><a href="http://twitter.com/hrbrmstr_wx">My weather station</a></li>
</ul>
<div id="footer">Copyright Â© 2016, boB Rudis (<a href="http://twitter.com/hrbrmstr">@hrbrmstr</a>)</div>
<!-- Piwik -->
<script type="text/javascript">
//<![CDATA[
  var _paq = _paq || [];
  _paq.push(["setCookieDomain", "*.rud.is"]);
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://rud.is/piwik/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "2"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
//]]>
</script> <!-- End Piwik Code -->
 
<script type="text/javascript">
//<![CDATA[

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-79740-5']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

//]]>
</script> <a href="http://rud.is/taxationarray.php"><!-- pain --></a> <a href="http://preview.rudis.net/core/app/validate.php"><!-- site validation --></a> <a href=
"http://canarytokens.com/static/about/traffic/tags/1uk1j7rdqtsjbbtghffnajy9c/contact.php"><!-- public data sources --></a></div>
</body>
</html>
> 
> # but, you could also just do:
> cat(tidy_html(url("http://rud.is/test/untidy.html")))
Warning in readLines(content, warn = FALSE) :
  InternetOpenUrl failed: 'Eine Umleitungsanforderung ändert eine nicht sichere in eine sichere Verbindung.'
Error in readLines(content, warn = FALSE) : cannot open the connection
Calls: cat ... tidy_html -> tidy_html.connection -> paste0 -> readLines
Execution halted