开发者

html parser for php? [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Best methods to parse 开发者_JS百科HTML

How to get href from anchor tag with particular class

hi guys,

I need an html parser. Baiscally given an html in a string i need to extract every href of

Which html parser for php do u suggest me? Someone that handles wrong html too.

Thanks


I would recommend using DOMDocument, it's often (always?) compiled with PHP 5.

You can use DOMXpath for extracting all href attributes.


This is the best tool I have tested to parse HTML and extract data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜