duzun / hQuery.php

An extremely fast web scraper that parses megabytes of invalid HTML in a blink of an eye. PHP5.3+, no dependencies.
https://duzun.me/playground/hquery
MIT License
361 stars 74 forks source link

how remove a node/element ? #29

Open kingofnull opened 6 years ago

kingofnull commented 6 years ago

Many html page contain script or other sort of unpleasant elements that need to be delete before fetching text. So a way to search and delete element is needed. so please if there is any way to delete a node describe how , and if not please plan to implement or guide me to add this option.

Thanks

Mecanik commented 6 years ago

Why not use preg_replace ? That's what I have done...

kingofnull commented 6 years ago

you can do that but there is no way to set node html! there are complex condition than you need pars html and get nodes and then remove them.

duzun commented 6 years ago

Is #7 what you are looking for?

kingofnull commented 6 years ago

Tanks duzun but I need node html and it do nothing on that. Is there any way to update node html?