Search engine

Question by Chris C:
Need PHP browser component with JavaScript interpreter?

Using php, I need to be able to find text and location of AdSense ads that are appearing on certain webpages. The problem is that AdSense ads are put there through JavaScript that is messing with the DOM.

Does anyone know of an HTML parser / JavaScript interpreter that is compatible with a backend PHP script?


——————————————

Answer by Steve D
The only way to read the current say of the DOM is with client-side Javascript. So to make it work with a PHP component that does something useful with the Adsense info, I think you will have to use an Ajax-type approach. Your client-side JS would communicate with your server-side PHP components.

However, this would not let you examine arbitrary pages containing Adsense. It would only work with pages where you can install your client-side piece.

I do not know of a way around this limitation. Maybe someone more inventive than I can think of one.

——————————————
Add your own answer in the comments!