-4
您好我正在尝试使用html编码从网页下载文件。 网页链接= http://www.nrldc.org/WBS/injsch.aspx 它工作正常,如果我今天下载它与以下代码。下载csv文件的第二天的HTML代码
<html>
<head>
<title>view injection schedule</title>
</head>
<body onload=form1.submit()>
<form name="form1" method="post" action="http://www.nrldc.org/wbs/injsch.aspx" id="form1">
<div>
<input type="hidden" name ="__EVENTTARGET" id="__EVENTTARGET" value="download" />
<input type="hidden" name ="__EVENTARGUMENT" id="__EVENTARGUMENT" value="filename.csv" />
</div>
<script type="text/javascript">
//<![cdata[
var theform = document.forms['form1'];
if (!theform) {
theform=document.form1;
}
function __dopostback(eventtarget,eventargument) {
if (!theform.onsubmit ||(theform.onsubmit() !=false)) {
theform.__eventtarget.value=eventtarget;
theform.__eventargument.value=eventargument;
theform.submit();
}
}
//]]>
</script>
</html>
现在在日期字段我想选择明天的日期,然后下载csv。我无法做到。任何帮助/建议请。
[HTMLTOCSV](https://jsfiddle.net/terryyounghk/kpegu/)一个例子。 –