GithubHelp home page GithubHelp logo

plenyun / advanced_html_dom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mastermunj/advanced_html_dom

0.0 1.0 0.0 16 KB

A better drop-in replacement for PHP's simple html dom

PHP 100.00%

advanced_html_dom's Introduction

Update: I tested this library with php 7.0.1 - 7.0.5 as well as PHP 5.3 and up, everything seems to be working.

The goal of this project is to be a DOM-based drop-in replacement for PHP's simple html dom library.

How To Use - The same way as simple. If you use file/str_get_html then you don't need to change anything. If you are instantiating with new simple_html_dom() then you will need to change that to new AdvancedHtmlDom()

What's Different - Mostly just formatting (spaces) in the html. This is added by DOM and there's no way around it. Some non-standard selectors have been dropped but many more standard ones have been added. For example: img[src!=foo] was removed because it's not a valid selector. Added are things like a + b and a ~ b or even a.foo:not(.bar)

What's Better

  • 10x-20x Performance increase
  • Reduced memory requirement
  • Support for many more css selectors

Features

  • Supports full set of css pseudo selectors plus many jquery extras: :not, :has, :contains, :gt, :lt, :eq
  • Use with css or xpath: $doc->find('h3 a'), $doc->find('//h3//a')
  • Jquery-style functions replace, wrap, unwrap, before after
  • Nodeset math: $doc->find('a')->minus($doc->find('.skip_me'))
  • Lots more features that haven't been documented yet.

If you love Advanced HTML Dom please vote for it here!

advanced_html_dom's People

Contributors

jhuebner avatar pguardiario avatar sunaram avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.