code4craft / webmagic

A scalable web crawler framework for Java.
http://webmagic.io/
Apache License 2.0
11.38k stars 4.18k forks source link

爬虫无法终止 #741

Open studyzhang opened 6 years ago

studyzhang commented 6 years ago

按照百度百科的例子程序,编写第一个爬虫,爬取的数据已经在控制台打印出来,但是eclipse 的terminate 一直是红灯,请问是什么原因呢,谢谢 如下代码: ` String url = “http://vip.stock.finance.sina.com.cn/corp/go.php/vMS_MarketHistory/stockid/600000.phtml?year=2018&jidu=1”;

    ResultItems resultItems = spider.<ResultItems>get(url);  
    System.out.println(resultItems);
    System.out.println("Game Over");`
studyzhang commented 6 years ago

Process的代码如下: ` public void process(Page page) { // TODO Auto-generated method stub page.putField("data", page.getHtml().xpath("//*[@id=\"con02-4\"]/tidyText()"));

}

`