Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6574929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:19:29+00:00 2026-05-25T15:19:29+00:00

<?php # don’t forget the library include(‘simple_html_dom.php’); # this is the global array we

  • 0
<?php

    # don't forget the library
    include('simple_html_dom.php');

    # this is the global array we fill with article information
    $Prices = array();

    getPrices('http://www.google.com/search?q=xbox+360&tbm=shop&hl=en&aq=f');

function getPrices($page) {
    global $Prices, $descriptions;

    $html = new simple_html_dom();
    $html->load_file($page);

    $items = $html->find('div.psliprice');   

    foreach($items as $post) {
        # remember comments count as nodes
        $Prices[] = $post->children(0)->outertext;
    }
}

?>


<html>
<head>
    <style>
        #main {
            margin: 80px auto;
            width: 600px;
        }
        h1 {
            font: bold20px/30px verdana, sans-serif;
            text-decoration: none;
        }
        p {
            font: 10px/14px verdana, sans-serif;
    </style>
</head>
<body>
    <div id="main">
<?php
    foreach($Prices as $item) {
        echo $item[0];
        #echo $item[1];
    }
?>
    </div>
</body>
</html>

The above just is outputting: <<<<<<<<<< anyone know why this is happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:19:30+00:00Added an answer on May 25, 2026 at 3:19 pm

    You have a syntax error:

    $items = $html->find('div[class=psliprice]"');
    

    Try this instead:

    $items = $html->find('div[class="psliprice"]');
    

    Also (I might be wrong), doesn’t Google have an API for such requests?


    Try this code instead:

    $Prices[] = $post->children(0)->outertext;
    

    And remove the echo $item[1]; line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't understand why this statement in PHP echos 'whaaa?' -- (0x0F | 0xF0)
I'm looking at this function: serialize() for PHP and I don't really understand what
I know PHP scripts don't actually compile until they are run. However, say I
I’m trying to make an RSS subscribers counter using PHP and don’t know where
Tried examples from 'php.net' but don't understand what's the problem. Any suggestions? <?php $_SESSION['test']
I'm quite experienced in PHP but I don't quite use mod_rewrite (although I should).
I'm creating a small framework for my web projects in PHP so I don't
I don't want PHP errors to display /html, but I want them to display
I don't use php or mysql but I am trying to upgrade a phpbb
I don't know how php.ini was configured since I don't have access to it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.