Java Code Examples for com.geccocrawler.gecco.request.HttpRequest#setCharset()

The following examples show how to use com.geccocrawler.gecco.request.HttpRequest#setCharset() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JDDetail.java    From gecco-htmlunit with MIT License 5 votes vote down vote up
public static void main(String[] args) throws Exception {
	HttpRequest request = new HttpGetRequest("http://item.jd.com/1455427.html");
	request.setCharset("GBK");
	GeccoEngine.create()
	.classpath("com.geccocrawler.gecco.htmlunit")
	//开始抓取的页面地址
	.start(request)
	//开启几个爬虫线程
	.thread(1)
	.run();
}
 
Example 2
Source File: JDDetail.java    From gecco with MIT License 5 votes vote down vote up
public static void main(String[] args) throws Exception {
	HttpRequest request = new HttpGetRequest("https://item.jd.com/1455427.html");
	request.setCharset("GBK");
	GeccoEngine.create()
	.classpath("com.geccocrawler.gecco.demo.ajax")
	//开始抓取的页面地址
	.start(request)
	//开启几个爬虫线程
	.thread(1)
	//单个爬虫每次抓取完一个请求后的间隔时间
	.interval(2000)
	.start();
}