Change the default status code from 200 to 0 & downloadSuccess from true to false, for Page.

pull/1179/head
Joe Zhou 4 months ago
parent 15ec80fcf1
commit 541ced9eea

@ -4,7 +4,6 @@ import org.apache.commons.lang3.StringUtils;
import us.codecraft.webmagic.selector.Html;
import us.codecraft.webmagic.selector.Json;
import us.codecraft.webmagic.selector.Selectable;
import us.codecraft.webmagic.utils.HttpConstant;
import us.codecraft.webmagic.utils.UrlUtils;
import java.util.ArrayList;
@ -43,9 +42,9 @@ public class Page {
private Map<String,List<String>> headers;
private int statusCode = HttpConstant.StatusCode.CODE_200;
private int statusCode;
private boolean downloadSuccess = true;
private boolean downloadSuccess;
private byte[] bytes;

@ -938,6 +938,7 @@ public class MockGithubDownloader implements Downloader{
Page page = new Page();
page.setRawText(html);
page.setStatusCode(200);
page.setDownloadSuccess(true);
page.setRequest(new Request("https://github.com/code4craft/webmagic"));
page.setUrl(new PlainText("https://github.com/code4craft/webmagic"));
return page;

Loading…
Cancel
Save