※ 引述《LE1115 (LE)》之銘言:
: ※ 引述《LE1115 (LE)》之銘言:
: 我重新研究了一下JDIC
: 在WebBrowser這個class中
: 發現了setURL這個method
: 他可以放三個參數
: * @param url
: * the URL to navigate to.
: * @param postData
: * the post data to send with the HTTP POST transaction.
: Forexample, <code>"username=myid&password=mypasswd"</code>
這東西是你要submit給這個網頁的資料
(這個你要翻一下網頁form/submit部份的書 不好解釋)
如果你單純要取得網頁source的話 一般而言不需要
: * @param headers
: * the HTTP headers to send with the HTTP POST transaction.
: Forex,<code>"content-type:text/html\r\ncontent-length:10"</code>
這個 基本上也用不到 這是送一些socket連線用的資訊,
比方說你連線的Browser是 ie或fx他都會送自己的識別資訊
除非你的目標網頁有做anti-bot的機制,否則應該不需要。
: 這邊我不太懂
: url是網址 就是輸入以後可以直接連結
: 那postData headers是做什麼的阿?
: 我可以利用他只讀取部份的網頁嗎
: 我試著把網頁原始碼貼到postData上面可是沒有用
: 他不會只擷取我貼的部份
: 所以想請問各位高手解答
: 感激不盡~~
你現在問題是什麼?
是不會取得網頁資料,
還是不會從網頁資料中取得你要的連結?
不要一次就想得到答案,好好的從流程開始想起要怎麼做再來問問題。
--
I am a person, and I am always thinking .
Thinking in love , Thinking in life ,
Thinking in why , Thinking in worth.
I can't believe any of what ,
I am just thinking then thinking ,
but worst of all , most of mine is thinking not actioning...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.134.27.68
※ 編輯: TonyQ 來自: 220.134.27.68 (05/25 21:40)