使用CURL </div>修改<div>元素

时间:2013-08-22 10:41:46

标签: php javascript html curl

我知道如何使用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函数,这些函数可以让我轻松地完成,但后来我错过了如何让它访问页面的信息。 ,所以我被困住了。

感谢您的帮助,

罗伯特

0 个答案:

没有答案