我正在尝试使用jsoup向此网站发布请求:https://www.obi.gr/obi/Default.aspx?tabid=125。这是英文版。但是jsoup.connect没有返回完整的html内容。它看起来很奇怪,因为当我向希腊版本发布请求时(希腊文版:https://www.obi.gr/obi/Default.aspx?tabid=124)我得到了完整的html内容
使用术语"不返回完整内容"我的意思是有缺少的HTML内容,我不能使网络刮。正如我之前说的,当我发布一些东西到希腊版本我得到完整的HTML内容,我可以让我的网络刮。
我有几件事情,例如设置超时属性或最大体型 或设置标题,但它都失败了。
这是我的代码:
String url1 ="https://www.obi.gr/obi/Default.aspx?tabid=125";
Document doc = null;
try {
doc=(Document) Jsoup.connect(url1).
data("ScrollTop", "appropriate value for the request body").
data("__EVENTARGUMENT","").
data("__EVENTTARGET","").
data("__VIEWSTATE","appropriate value for the request body").
data("__VIEWSTATEGENERATOR","appropriate value for the request body").
data("__dnnVariable","appropriate value for the request bodyot>").
data("dnn$SEARCH1$txtSearch","").
data("dnn$UcEMTWrapper1$ctl00$btnSearch","appropriate value for the request body").
data("dnn$UcEMTWrapper1$ctl00$ddlPriorityCountry","").
data("dnn$UcEMTWrapper1$ctl00$txtApplDate","").
data("dnn$UcEMTWrapper1$ctl00$txtApplNumber","").
data("dnn$UcEMTWrapper1$ctl00$txtClassificationIpc","").
data("dnn$UcEMTWrapper1$ctl00$txtClassificationLocarno","").
data("dnn$UcEMTWrapper1$ctl00$txtEPOApplDate","").
data("dnn$UcEMTWrapper1$ctl00$txtEPOApplNumber","").
data("dnn$UcEMTWrapper1$ctl00$txtEPOPublDate","").
data("dnn$UcEMTWrapper1$ctl00$txtEPOPublNumber","").
data("dnn$UcEMTWrapper1$ctl00$txtGrantDate","").
data("dnn$UcEMTWrapper1$ctl00$txtInventionTitle","car").
data("dnn$UcEMTWrapper1$ctl00$txtInventor","").
data("dnn$UcEMTWrapper1$ctl00$txtOwner","").
data("dnn$UcEMTWrapper1$ctl00$txtPatentNumber","").
data("dnn$UcEMTWrapper1$ctl00$txtPriorityDate","").
data("dnn$UcEMTWrapper1$ctl00$txtPriorityNumber","").
data("dnn$UcEMTWrapper1$ctl00$txtReceiptNumber","").
data("dnn$UcEMTWrapper1$ctl00$txtRepresentative","").
data("dnn$UcEMTWrapper1$ctl00$txtSupplementaryCertificates","").
userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36")
.post();
} catch (IOException ex) {
//an exception probalby will be cause if Obi changes its request body
Logger.getLogger(JSoupWrapper.class.getName()).log(Level.SEVERE, null, ex);
}
System.out.println(doc.toString());