You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
386 B
14 lines
386 B
/**
|
|
* 爬取控制类(MVC-控制层)
|
|
*/
|
|
public class CrawlController {
|
|
public void crawl(String url) {
|
|
// 验证URL格式
|
|
if (!UrlValidator.isValidUrl(url)) {
|
|
System.out.println("URL格式非法:" + url);
|
|
return;
|
|
}
|
|
// 执行爬取逻辑(示例)
|
|
System.out.println("爬取URL:" + url + " 成功");
|
|
}
|
|
}
|