67,512
社区成员
发帖
与我相关
我的任务
分享
package test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Test1 {
public static void main(String[] args) throws IOException {
URL urlmy = new URL("http://hotel.qunar.com/city/guangzhou/dt-5725/?tag=guangzhou#fromDate=2013-11-09&toDate=2013-11-10&q=%E5%B9%BF%E5%B7%9E%E7%B2%A4%E6%B5%B7%E5%96%9C%E6%9D%A5%E7%99%BB%E9%85%92%E5%BA%97&from=qunarindex%7Csug&filterid=e711d861-9aa5-449f-9089-8ac9ad8a0174_C&showMap=0&qptype=hotelName|poi&haspoi=1&from=qunarindex%7Csug&QHFP=ZSS_A3A44DB2&QHPR=1_1_0_0");
HttpURLConnection con = (HttpURLConnection) urlmy.openConnection();
con.setFollowRedirects(true);
con.setInstanceFollowRedirects(false);
con.connect();
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(),"UTF-8"));
String str = "";
StringBuffer reader = new StringBuffer("");
while ((str = br.readLine()) != null) {
reader.append(str+"\r\n");
}
System.out.println(reader);
}
}
<table cellspacing="0" cellpadding="0">
<tr>
<th>入住日期</th>
<td valign="top" class="c1">
<div class="qcbox qdate fromD">
<input class="textbox" id="refromDate" name="refromDate" maxlength="10" autocomplete="off"/>
</div>
</td>
<th>离店日期</th>
<td valign="top" class="c2">
<div class="qcbox qdate toD">
<input class="textbox" id="retoDate" name="retoDate" maxlength="10" autocomplete="off"/>
</div>
</td>
<td valign="top" class="c3"><button class="btn_research" onclick="bookTool.research('')"><b>重新搜索</b></button></td>
</tr>
<tr>
<td colspan="5">
<div class="searchresulttips">
<div class="proc" id="statusBar"></div>
<div class="proc_none" id="nonePrice">正在获取该酒店信息...</div>
<div class="scheduled" id="lastBooking"></div>
</div>
</td>
</tr>
</table>