Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2005, 01:34 AM
Authorized User
 
Join Date: Dec 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP Web-browser DOM functionality

I need the equivalent of a client-side web-browser with Document Object Model (DOM) functionality that runs on the server-side. The DOM should support one of the standards with the usual properties (.document... ), methods (.navigate...), collections (.anchors), events(.onclick...) etc. One might think of this as the core of a more advanced webcrawler; however, most PHP webcrawlers I've seen are very primitive - they don't even create a DOM of HTML tags within navigated pages. I don't have enough time to write a full DOM parser - and DOMXML is just too limited to use. Does anyone have any ideas?

Philibuster
__________________
Philibuster
 
Old August 15th, 2006, 09:34 PM
Authorized User
 
Join Date: Dec 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In the end, I implemented a LibCurl interface with a SAX Parser to construct an OO DOM model. LibCurl handled http/https, cookies, and other HTTP requirements. The OO DOM was constructed via the SAX call-back functions (begin, character, end). DOM construction was somewhat slow so I needed to create several short-cuts; for example, use meta-references into a buffer/cache instead of keeping separate segment copies, limit tag collections, etc. Handling HTML with syntactical errors required additional techniques (stack recovery rules and precedences). Final results were acceptable but there is still room for improvement.



Philibuster





Similar Threads
Thread Thread Starter Forum Replies Last Post
publish asp.net site functionality as web service amzar .NET Web Services 2 August 14th, 2007 11:26 PM
Applet needs full browser pane w/ DOM access. Philibuster BOOK: Beginning Java 2 1 August 15th, 2006 09:22 PM
DOM functionality. Urgent NEO1976 Javascript 6 July 16th, 2006 04:12 PM
Web part functionality like http://www.thefreedict kamii47 ASP.NET 2.0 Professional 0 June 10th, 2006 01:36 AM
PHP File Doesn't Open in Browser kara333 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 November 29th, 2004 11:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.