1
我必须解析html页面。我必须在下面的HTML中提取名称元素的值,该值被分配给一个javascript函数。我如何使用JSoup来做到这一点。如何在解析html页面时从html页面的javascript函数中提取变量的值
<input type="hidden" name="fields.DEPTID.value"/>
JS:
departmentId.onChange = function(value) {
var departmentId = dijit.byId("departmentId");
if (value == null || value == "") {
document.transferForm.elements["fields.DEPTID.value"].value = "";
document.transferForm.elements["fields.DEPTID_DESC.value"].value = "";
} else {
document.transferForm.elements["fields.DEPTID.value"].value = value;
document.transferForm.elements["fields.DEPTID_DESC.value"].value = departmentId.getDisplayedValue();
var locationID = departmentId.store.getValue(departmentId.item, "loctID");
var locationDesc = departmentId.store.getValue(departmentId.item, "loct");
locationComboBox = dijit.byId("locationId");
if (locationComboBox != null) {
if (locationID != "") {
setLocationComboBox(locationID, locationDesc);
} else {
setLocationComboBox("AMFL", "AMFL - AMY FLORIDA");
}
}
}
};
我需要脚本中的属性“name”值。但是,我不会写脚本的名字,因为我必须编写一个通用解析器来解析任何html页面。我不知道如何使用上面的代码,因为我不知道如何替换脚本。你能否请澄清上述代码。 – user1445177 2012-07-25 18:49:33