JS is for HTML, for example, I want to verify
So with jquery, alert ($ (' #demo_div '). attr (' Display ')), but what if I use server-side PHP to crawl a DOM element in a Web page and then combine CSS to parse its CSS properties? Is there a function or class that has been written?
Reply content:
JS is for HTML, for example, I want to verify
So with jquery, alert ($ (' #demo_div '). attr (' Display ')), but what if I use server-side PHP to crawl a DOM element in a Web page and then combine CSS to parse its CSS properties? Is there a function or class that has been written?
Supplement 3:
Please read the Supplementary 2 and review 7 floor of this question before you "like" the question, and think about whether you should do so.
The landlord's Y problem itself is still possible, but the main problem to make XY problem bad practice, it should be a lesson.
Supplement 2:
All right, you're a problem master!
Noisy for a long time, a short length of two answers, transfer 3 members 6 floor reviews, ask you a half-day you just say what to do!!!
Why didn't you explain your original purpose before?
Typical XY problem--Kezhouqiujian, ask the non-request, must first trouble the community for a half-day to find out your purpose, really little meaning. Master Please read this article first.
I read the question of the main problem of the response, almost all of the problems are negative points, I think the question of the Lord you this problem should be found stepping.
You better go back to reflect on it, read a few more times the wisdom of questioning, less to the community left some inexplicable, wasting time guessing game.
Supplement 1:
You might consider using PHP to call a render core that supports only html+css (without JS) and then take the rendering results. This will at least:
- Properly tolerate small problems in HTML and get a standard tree-shaped DOM structure
- Accurately handle CSS overlay relationships to correctly get any CSS properties for a particular element
If you want to do extermination implementation, do not think that only within the framework of PHP to do this thing.
Fully realize your needs, relying solely on any PHP library, can not be killed. any. Not even death. No doubt.
Because of a simple principle: if you only parse the HTML string text of a Web page, we simply cannot tell what state the last property of Demo_div is in.
For example, in your case,display
property is used for additional