Re: [問題]如何使用J2SE去網頁自動填表單?
我想我從最基本的開始問好了@@
我今天想要連到yahoo, 蒐尋Federer, 然後把回傳的網頁印出來
我寫了
PostMethod post = new PostMethod("http://tw.yahoo.com");
post.addParameter("p", "Federer");
//p應該是那個搜尋表格的名字,如果我沒弄錯的話...
HttpClient client = new HttpClient();
int status = client.executeMethod(post);
BufferedReader in = new BufferedReader(new
(接著)InputStreamReader(post.getResponseBodyAsStream(),"UTF-8"));
String line = "";
while((line = in.readLine()) != null)
System.out.println(line);
in.close();
但是這樣回傳的結果就只是yahoo的首頁的內容而已
請問是錯在哪裡了呢@@
應該是錯得很扯吧...請大家包涵
謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.85.164
推
07/01 18:51, , 1F
07/01 18:51, 1F
→
07/01 21:35, , 2F
07/01 21:35, 2F
→
07/01 21:36, , 3F
07/01 21:36, 3F
推
07/02 01:40, , 4F
07/02 01:40, 4F
推
07/02 15:07, , 5F
07/02 15:07, 5F
→
07/02 22:47, , 6F
07/02 22:47, 6F
→
07/03 12:12, , 7F
07/03 12:12, 7F
討論串 (同標題文章)
完整討論串 (本文為第 5 之 5 篇):
java 近期熱門文章
PTT數位生活區 即時熱門文章