0

我知道如何使用 CURL curl_setopt 函数提供或修改字段并使用 cookie,但我找不到如何使用 CURL 修改 HTML 元素。

例如,假设我想在下面的代码中替换函数“submit_device_form”

<div id="bottombuttons">
  <table border="0" cellspacing="0" cellpadding="0" style="width:100%;">
  <!-- buttons -->
    <tr>
      <td>&nbsp;</td>
      <td class="separatorButton">
      <table border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><a href="#" onclick="javascript:submit_device_form(); return false;" class="buttonLink100">Set</a></td>
          <td><a href="#" onclick="javascript:cancel_device_form(); return false;" class="buttonLink100">Cancel</a></td>
        </tr>
      </table>
      </td>
    </tr>
  <!-- fixes the width of the first column -->
    <tr>
      <td style="padding:0;"><img src="images/spacer.gif" alt="" width="200" height="1" border="0" ></td>
      <td style="padding:0;"><img src="images/spacer.gif" alt="" width="360" height="1" border="0" ></td>
    </tr>
  </table>
</div> 

使用“submit_MY_form”,这是我的 PHP 脚本中包含的一个新 JavaScript 函数。我该怎么做?

我查看了“PHP Simple HTML DOM Parser”库,因为它提供了 setAttribute 和 removeAttribute 函数,可以让我轻松地做到这一点,但是我错过了有关如何让它访问通过 CURL 读取的页面的信息,所以我卡住了。

谢谢你的帮助,

罗伯特

4

0 回答 0