开发者

PHP: simple_html_dom - how to find elements that are NOT in a certain class?

I'm using simple_html_dom in PHP to get all A-tags inside a html page. But some tags are inside a div that should be ignored.

I guess I need something like :

$htmldom->find("!div[class=blabla] a");

I found that I can use [attribute!=value] to specify elements that do NOT have a certain attrib开发者_开发百科ute value, but how would this work for elements?


You basically had it:

$htmldom->find("[class!=blabla] a");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜