浏览器正在改变html标记。如何强制所有浏览器使用本机标记?

时间:2015-02-26 12:41:03

标签: php jquery html browser xpath

我有一个问题,希望有人可以帮助我。 我将iframe与src="http://my.own.domain/some/path/file-1";

一起使用

此网址向我发送"http://some-site.com/path1/path2/path3/qwerty.html";

的内容

但在发送内容之前,我预先处理了链接和资源。

例如,如果是css <link rel="/css/style1">,我会为其添加协议和主机并制作类似<link rel="http://some-site.com/css/style1">

的内容

在我点击某个页面元素并通过js读取当前节点信息(当前节点的名称和属性,父节点的名称和属性,直到我看到html标签)。 这个数据我使用ajax发送到php脚本。 使用php我将它转换为XPath选择器,看到我的选择器不正确。

//html
    /body[0]
    /div[@id='wrap']
    /div[@id='main']
    /table[contains(@class, 'content-wrapper')][1]
    /tbody[1]
    /tr[1]
    /td[contains(@class, 'content-wrap')][1]
    /div[contains(@class, 'content')][1]
    /div[contains(@class, 'node')][1]
    /div[contains(@class, 'techs')][1]
    /table[1]
    /tbody[1]
    /tr[4]
    /td[contains(@class, 'techs-right')][1]

但该页面的原生标记是:

//html
        /body[0]
        /div[@id='wrap']
        /div[@id='main']
        /table[contains(@class, 'content-wrapper')][1]
             /*/tbody[1] - without this*/
        /tr[1]
        /td[contains(@class, 'content-wrap')][1]
        /div[contains(@class, 'content')][1]
        /div[contains(@class, 'node')][1]
        /div[contains(@class, 'techs')][1]
        /table[1]
             /*/tbody[1] - without this*/
        /tr[4]
        /td[contains(@class, 'techs-right')][1]

似乎浏览器正在修改不正确的标记并使其正确..但这对我来说是一个障碍。如何关闭它?

0 个答案:

没有答案