While[Length@toVisit > 0,
current = First@toVisit;
AppendTo[visited, current];
toVisit = Rest@toVisit;
response = URLRead[current, Interactive -> False];
If[response["StatusCode"] == 200,
html = response["Body"];
links =
ImportString[html, {"HTML", "Hyperlinks"}] //
Map[Quiet@resolveURL[current, #] &] // Cases[_String];
toVisit = Join[
toVisit,
links //
Map@URLBuild(*clean up trailing /'s*)//
Select[
URLParse[#, "Domain"] == currentDomain &&