要采集的地址是:http://wsgh.nbws.gov.cn/PlanList.shtml
PYTHON代码如下:
res=re.findall('<td style=\"width:80px;\">2015-10-26</td><td style=\"width:170px;\">(.*?)</td>',html,re.S);
print res
html代码如下:
<table class="GridView_General" cellspacing="0" cellpadding="0" border="0" id="GridViewReg" style="width:100%;border-collapse:collapse;table-layout:fixed">
<tr class="GridView_SelectedRow">
<td style="width:45px;">1</td><td style="width:80px;">2015-10-26</td><td style="width:170px;">中医院</td><td style="width:100px;">中医</td><td style="width:50px;"><a href="/DoctorBrief/41952988403.shtml" target="_blank" style="color:Blue;text-decoration:underline;">医生</a></td><td style="width:65px;">周一</td><td style="width:45px;">0</td><td style="width:45px;">21</td><td style="width:55px;">20</td><td style="color:Green;width:55px;">1</td><td align="center" style="width:40px;"><input type="submit" name="GridViewReg$ctl02$btnReg" value="预约" id="GridViewReg_ctl02_btnReg" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" style="width:40px;" />
</td>
</tr><tr class="GridView_AlternatingRow">
<td style="width:45px;">2</td><td style="width:80px;">2015-10-26</td><td style="width:170px;">中医院</td><td style="width:100px;">中医</td><td style="width:50px;"><a href="/DoctorBrief/41952988403.shtml" target="_blank" style="color:Blue;text-decoration:underline;">医生</a></td><td style="width:65px;">周一</td><td style="width:45px;">0</td><td style="width:45px;">21</td><td style="width:55px;">20</td><td style="color:Green;width:55px;">0</td><td align="center" style="width:40px;"><input type="submit" name="GridViewReg$ctl03$btnReg" value="预约" id="GridViewReg_ctl03_btnReg" disabled="disabled" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" style="width:40px;" />
</td>
</tr><tr class="GridView_Row">
<td style="width:45px;">3</td><td style="width:80px;">2015-10-28</td><td style="width:170px;">中医院</td><td style="width:100px;">中医</td><td style="width:50px;"><a href="/DoctorBrief/41952988403.shtml" target="_blank" style="color:Blue;text-decoration:underline;">医生</a></td><td style="width:65px;">周三</td><td style="width:45px;">0</td><td style="width:45px;">60</td><td style="width:55px;">10</td><td style="color:Green;width:55px;">0</td><td align="center" style="width:40px;"><input type="submit" name="GridViewReg$ctl04$btnReg" value="预约" id="GridViewReg_ctl04_btnReg" disabled="disabled" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" style="width:40px;" />
</td>
</tr><tr class="GridView_AlternatingRow">
<td style="width:45px;">4</td><td style="width:80px;">2015-10-29</td><td style="width:170px;">中医院</td><td style="width:100px;">中医</td><td style="width:50px;"><a href="/DoctorBrief/41952988403.shtml" target="_blank" style="color:Blue;text-decoration:underline;">医生</a></td><td style="width:65px;">周四</td><td style="width:45px;">0</td><td style="width:45px;">21</td><td style="width:55px;">20</td><td style="color:Green;width:55px;">0</td><td align="center" style="width:40px;"><input type="submit" name="GridViewReg$ctl05$btnReg" value="预约" id="GridViewReg_ctl05_btnReg" disabled="disabled" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" style="width:40px;" />
</td>
</tr>
</table>
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
业精于勤,荒于嬉;行成于思,毁于随。