如何从网页上抓取数据?

I need to show some news from web page, so I need to extract data from web site. But I am unable to extract data as the following code:

$html=file_get_html("http://listverse.com/2014/12/01/10-times-us-foreign-policy-was-wildly-inconsistent/");
     foreach($html->find('article h2') as $element)
     {
        echo "<h2>".$element->plaintext."</h2>"."<br>";

        foreach ($html->find('article h2 p') as $element1) {

            echo "<pre>";print_r($element1->plaintext );
        }

But I got correct header but each paragraph is redundant.

The paragraphs follow the headings, they aren't descendants of them (and HTML doesn't allow paragraphs to descend from headings anyway).

Having got the headings, you need to look at their siblings (e.g. looping over them until you get one that isn't a paragraph or is another heading).