package main;
import com.company.MingLuSpider;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
for (int i = 0; i < 11; i++) {
if (i == 0) {
new MingLuSpider().GetRequestData("https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E", i);
} else {
System.out.println(i);
new MingLuSpider().GetRequestData("https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d",i);
}
}
}
}
请问这是为啥?这个%d占位符 报错
报错如下,数字都打印出来了,但是这个占位符貌似报错了
1
2
3
4
5
6
7
8
9
java.lang.IllegalArgumentException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI.create(URI.java:852)
at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:66)
at com.company.MingLuSpider.GetRequestData(MingLuSpider.java:28)
at main.Main.main(Main.java:14)
Caused by: java.net.URISyntaxException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.scanEscape(URI.java:2978)
at java.net.URI$Parser.scan(URI.java:3001)
at java.net.URI$Parser.checkChars(URI.java:3019)
at java.net.URI$Parser.parseHierarchical(URI.java:3111)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
... 3 more
java.lang.IllegalArgumentException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI.create(URI.java:852)
at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:66)
at com.company.MingLuSpider.GetRequestData(MingLuSpider.java:28)
at main.Main.main(Main.java:14)
Caused by: java.net.URISyntaxException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.scanEscape(URI.java:2978)
at java.net.URI$Parser.scan(URI.java:3001)
at java.net.URI$Parser.checkChars(URI.java:3019)
at java.net.URI$Parser.parseHierarchical(URI.java:3111)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
... 3 more
java.lang.IllegalArgumentException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI.create(URI.java:852)
at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:66)
at com.company.MingLuSpider.GetRequestData(MingLuSpider.java:28)
at main.Main.main(Main.java:14)
Caused by: java.net.URISyntaxException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.scanEscape(URI.java:2978)
at java.net.URI$Parser.scan(URI.java:3001)
at java.net.URI$Parser.checkChars(URI.java:3019)
at java.net.URI$Parser.parseHierarchical(URI.java:3111)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
... 3 more
java.lang.IllegalArgumentException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI.create(URI.java:852)
at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:66)
at com.company.MingLuSpider.GetRequestData(MingLuSpider.java:28)
at main.Main.main(Main.java:14)
Caused by: java.net.URISyntaxException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.scanEscape(URI.java:2978)
at java.net.URI$Parser.scan(URI.java:3001)
at java.net.URI$Parser.checkChars(URI.java:3019)
at java.net.URI$Parser.parseHierarchical(URI.java:3111)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
... 3 more
java.lang.IllegalArgumentException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI.create(URI.java:852)
at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:66)
at com.company.MingLuSpider.GetRequestData(MingLuSpider.java:28)
at main.Main.main(Main.java:14)
Caused by: java.net.URISyntaxException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.scanEscape(URI.java:2978)
at java.net.URI$Parser.scan(URI.java:3001)
at java.net.URI$Parser.checkChars(URI.java:3019)
at java.net.URI$Parser.parseHierarchical(URI.java:3111)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
... 3 more
java.lang.IllegalArgumentException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI.create(URI.java:852)
at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:66)
at com.company.MingLuSpider.GetRequestData(MingLuSpider.java:28)
at main.Main.main(Main.java:14)
Caused by: java.net.URISyntaxException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.scanEscape(URI.java:2978)
at java.net.URI$Parser.scan(URI.java:3001)
at java.net.URI$Parser.checkChars(URI.java:3019)
at java.net.URI$Parser.parseHierarchical(URI.java:3111)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
... 3 more
java.lang.IllegalArgumentException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI.create(URI.java:852)
at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:66)
at com.company.MingLuSpider.GetRequestData(MingLuSpider.java:28)
at main.Main.main(Main.java:14)
Caused by: java.net.URISyntaxException: Malformed escape pair at index 68: https://gongshang.mingluji.com/beijing/diqu/%E4%B8%9C%E5%9F%8E?page=%d
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.scanEscape(URI.java:2978)
at java.net.URI$Parser.scan(URI.java:3001)
at java.net.URI$Parser.checkChars(URI.java:3019)
at java.net.URI$Parser.parseHierarchical(URI.java:3111)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…