开发者

html parser for php? [duplicate]

开发者 https://www.devze.com 2023-02-05 05:53 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: Best methods to parse 开发者_JS百科HTML
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

精彩评论

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