Re: [請益] 有關於禁止其他人抓html原始碼的問題
※ 引述《JohnGod21 (江神Johnson)》之銘言:
: PHP 瀏覽其他網頁的html原始碼,方法很多
: 我找版上的的方法就一堆
: 舉例來說
: <?
: header('Content-Type: text/html; charset=utf-8');
: $search_url = "網址";
: $page = implode('', file($search_url));
: echo $page;
: ?>
: <?
: $html = file('網址');
: echo $html;
: ?>
: <?
: $url = "網址";
: $ch = curl_init();
: curl_setopt($ch, CURLOPT_URL, $url);
: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
: $content = curl_exec($ch);
: echo $content;
: ?>
: <?
: $url = "網址";
: $content = file_get_contents("$url");
: echo $content;
: ?>
: 但是我用這些方法,去瀏覽露天拍賣的網站的時候,都會出現
: HTTP request failed! Access Deny!! Detect your Browser to install malicious
: plug-in or Illegal access
: 請問一下,我用上述的方法去瀏覽其他網站都算malicious的嗎?
: 再問一下,露天這樣的防禦手法,要如何撰寫?
: 這樣的話PHP是不是就永遠抓不到露天拍賣的html原始檔?
: 我的測試我的露天測試網址是
: http://search.ruten.com.tw/search/s000.php?searchfrom=headbar&k=wii&t=0
: 是尋找Wii的賣家
: 請各位高手為小弟我解答,謝謝
資料丟給server的不夠齊全...
你可以隨意弄個sniffer軟體...看一下瀏覽器丟給web server的資訊
也許僅是HTTP_USER_AGENT資料丟不夠而已..
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.26.19.48
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章