File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -97,11 +97,17 @@ public void InitilizeCreateReport()
97
97
98
98
//Environment.Exit(0);
99
99
}*/
100
-
100
+ int depthLimit = 0 ;
101
101
private void CrawlPage ( string url )
102
102
{
103
+
103
104
if ( ! PageHasBeenCrawled ( url ) )
104
105
{
106
+ if ( depthLimit ++ >= 5 )
107
+ {
108
+ return ;
109
+ }
110
+
105
111
var htmlText = GetWebText ( url ) ;
106
112
107
113
var linkParser = new LinkParser ( ) ;
@@ -179,7 +185,8 @@ private void CrawlPage(string url)
179
185
180
186
if ( formattediLink != String . Empty )
181
187
{
182
- links . Add ( new Link ( " " , "==============Crawling to new internal page from " + iLink + "...==============" ) ) ;
188
+
189
+ links . Add ( new Link ( " " , "==============Crawling to new internal page " + iLink + "...==============" ) ) ;
183
190
CrawlPage ( formattediLink ) ;
184
191
}
185
192
}
You can’t perform that action at this time.
0 commit comments