My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
WebPageGrabber  
WebPageGrabber 網頁快照函式 說明頁
Updated Feb 4, 2010 by JanoC...@gmail.com

Introduction

  • 本程式是參考 imagegrabwindow() 的範例修改而成,主要是增加“能夠完整的拍攝大於一個畫面的網頁”的功能。
  • 利用 COM 呼叫 IE (InternetExplorer.Application) 瀏覽網頁,再用 imagegrabwindow() 將畫面拍下。
  • 若網頁內容超過一張畫面,則透過 COM 命令 IE 捲動到各個頁面後拍攝,再將畫面合併。

Details

Requirements 執行環境需求

  • PHP 5.2.2 with GD extension
  • Windows OS with Internet Explorer

Examples 程式範例

<?php
include('WebPageGrabber.inc.php');

$url = 'http://www.php.net/downloads.php';
$filename = date('YmdHis') . '.jpg';

$im = web_page_grabber($url);

imagejpeg($im, $filename);
?>

Notes 附註

  • imagegrabwindow() 在開發環境中,需要約 2 秒左右才能抓取一個畫面。
  • Scrollbar 的寬度暫訂為 16px (僅符合一般情況)。

See Also

Comment by louk....@gmail.com, Sep 24, 2011

hi, 不知道是否可以分享程式檔案?

感謝


Sign in to add a comment
Powered by Google Project Hosting