在php中使用tidy提取html的一部分
我想在 php 中使用 tidy 提取 HTML 的特定部分。
html 页面中有表格,我只想从 html 页面获取该表格。
请帮助并发布解决方案...
谢谢
I want to extract particular part of HTML using tidy in php.
the html page has table in it and i just want to fetch that table from html page.
please help and post the solution....
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 PHP Simple DOM 解析器 更适合这项工作。网站上有很好的使用示例。
抓取表格的函数应该如下所示(未经测试但应该可以工作):
The PHP Simple DOM parser is better suited for the job I think. There are good usage examples on the site.
A function to grab a table should look like this (untested but should work):