Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 28th, 2005, 01:34 AM
Authorized User
Points: 138, Level: 2
Points: 138, Level: 2 Points: 138, Level: 2 Points: 138, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: McHenry, IL, .
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
Reply With Quote
  #2 (permalink)  
Old August 15th, 2006, 09:34 PM
Authorized User
Points: 138, Level: 2
Points: 138, Level: 2 Points: 138, Level: 2 Points: 138, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: McHenry, IL, .
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:00 AM.


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