HTML就像:
for row_num in range(len(ws.rows)):
^
SyntaxError: invalid syntax
我使用jsoup来解析html,如下所示
<form method="post" action="stepB1.asp" name="form1" id="Form1" onsubmit="return CheckData();">
<select name="syear" class="inputbox" id="Select1">
<option value="104">104</option>
<option value="105">105</option>
</select> YEAR
<select name="smonth" class="inputbox" id="Select2">
<option value="01"> 1</option>
<option value="02"> 2</option>
<option value="03"> 3</option>
<option value="04"> 4</option>
<option value="05"> 5</option>
<option value="06"> 6</option>
<option value="07"> 7</option>
<option value="08"> 8</option>
<option value="09"> 9</option>
<option value="10"> 10</option>
<option value="11"> 11</option>
<option value="12"> 12</option>
</select>
然后结果:
Document docs = Jsoup.connect(param).timeout(3000).data("syear", "104").data("smonth", "07").post();
System.out.println(docs.toString());
07已选中但<form method="post" action="step.asp" name="form1" id="Form1" onsubmit="return CheckData();">
<select name="syear" class="inputbox" id="Select1">
<option value="104">104</option>
<option value="105">105</option>
</select>
YEAR <select name="smonth" class="inputbox" id="Select2">
<option value="01"> 1</option>
<option value="02"> 2</option>
<option value="03"> 3</option>
<option value="04"> 4</option>
<option value="05"> 5</option>
<option value="06"> 6</option>
<option value="07" selected> 7</option>
<option value="08"> 8</option>
<option value="09"> 9</option>
<option value="10"> 10</option>
<option value="11"> 11</option>
<option value="12"> 12</option>
</select>
未选中。
有什么建议吗?
我期待结果:
syear