查找堆叠的div类与简单的HTML DOM解析器 [英] Find stacked div class with Simple HTML DOM Parser

查看:164
本文介绍了查找堆叠的div类与简单的HTML DOM解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 PHP简单HTML DOM解析器,并且在HTML页面中有一个部分以下来源:

I am using PHP Simple HTML DOM Parser and there is a section in the html page with the following source:

<div class="box-content padding-top-1 padding-bottom-1 font-size-3">
    <ul>
        <li>
            <a href="link1">linkdescription 1</a>
        </li>
        <li>
            <a href="link2">linkdescription 2</a>
        </li>
    </ul>
</div>

如何获取使用堆叠类标识符的链接列表?

How can I now get the list of links with using the stacked class identifier?

这里是我目前尝试的:


  • 列表项目$ html - > find('。box-content padding-top-1 padding-bottom-1 font-size-3'));

    • 返回空


    • 返回框中的其他网页元素


    • 不介意:(

    推荐答案

    或者您可以尝试:

    List item $html->find('div[class=box-content padding-top-1 padding-bottom-1 font-size-3]');
    

    这篇关于查找堆叠的div类与简单的HTML DOM解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆