Using PHP to get DOM Element

后端 未结 2 1173
别跟我提以往
别跟我提以往 2020-11-29 06:35

I\'m struggling big time understanding how to use the DOMElement object in PHP. I found this code, but I\'m not really sure it\'s applicable to me:

$dom = n         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 07:23

    You won't have access to the HTML if the redirect is from an external server. Let me put it this way: the DOM does not exist at the point you are trying to parse it. What you can do is pass the text to a DOM parser and then manipulate the elements that way. Or the better way would be to add it as another GET variable.

    EDIT: Are you also aware that the client can change the HTML and have it pass whatever they want? (Using a tool like Firebug)

提交回复
热议问题