douyan1321 2012-04-24 17:04
浏览 282
已采纳

获取javascript参数的XPath查询

I've just started using XPath queries in php and while a lot is very self-explanatory I'm wordering if it's possible to get the values of an onclick() function.

An example

<a id="moreButton" onclick="showMore('#content','/page/2');">Show More</a>

The best I have come up with is //a[@id='moreButton']/@onclick which returns showMore('#content','/page/2');

Can I further refine it to only return /page/2 or will I just have to use php to parse what I have?

  • 写回答

2条回答 默认 最新

  • doukuibi9631 2012-04-24 17:14
    关注

    You must parse it with something else, XPath doesn't understand JavaScript

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求.net core 几款免费的pdf编辑器
  • ¥20 SQL server表计算问题
  • ¥15 C# P/Invoke的效率问题
  • ¥20 thinkphp适配人大金仓问题
  • ¥20 Oracle替换.dbf文件后无法连接,如何解决?(相关搜索:数据库|死循环)
  • ¥15 数据库数据成问号了,前台查询正常,数据库查询是?号
  • ¥15 算法使用了tf-idf,用手肘图确定k值确定不了,第四轮廓系数又太小才有0.006088746097507285,如何解决?(相关搜索:数据处理)
  • ¥15 彩灯控制电路,会的加我QQ1482956179
  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)