-4
こんにちは、HTMLコードを使用してWebページからファイルをダウンロードしようとしています。 ウェブリンク= 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>
now in dateフィールドtomorrows dateを選択してからcsvをダウンロードします。私はそれをすることができません。任意の助け/提案pls。
[HTMLTOCSV](https://jsfiddle.net/terryyounghk/kpegu/)1つの以上の例。 –