作者TonyQ (骨头)
看板java
标题Re: [问题]请问如果用java观看网路上的影片ex.yout …
时间Sun May 25 21:39:23 2008
※ 引述《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)