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

  • SEARCH
  • Home
  • 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 6793611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:07:15+00:00 2026-05-26T18:07:15+00:00

I am trying to pull the price and seller from the amazon offer listing

  • 0

I am trying to pull the price and seller from the amazon offer listing pages found at:

http://www.amazon.com/gp/offer-listing/B002UYSHMM

I can get the price by using:

$ret['Retail'] = $html->find('span[class="price"]', 0)->innertext;

This pulls the first price in the offer listing

I tried to pull the matching seller of the first price by using the below to get the alt value from the img which contains the seller name:

$ret['SoldBy'] = $html->find('ul.sellerInformation img', 0)->getAttribute('alt');

It worked for the first one but as I went down it started missing sellers and even missing prices in some cases.

Can anyone tell why it would miss sellers and even jump around on prices? All I did to get additional sellers is:

$ret['Retail2'] = $html->find('span[class="price"]', 1)->innertext;
$ret['SoldBy2'] = $html->find('ul.sellerInformation img', 1)->getAttribute('alt');
$ret['Retail3'] = $html->find('span[class="price"]', 2)->innertext;
$ret['SoldBy3'] = $html->find('ul.sellerInformation img', 2)->getAttribute('alt');
$ret['Retail4'] = $html->find('span[class="price"]', 3)->innertext;
$ret['SoldBy4'] = $html->find('ul.sellerInformation img', 3)->getAttribute('alt');
$ret['Retail5'] = $html->find('span[class="price"]', 4)->innertext;
$ret['SoldBy5'] = $html->find('ul.sellerInformation img', 4)->getAttribute('alt');
$ret['Retail6'] = $html->find('span[class="price"]', 5)->innertext;
$ret['SoldBy6'] = $html->find('ul.sellerInformation img', 5)->getAttribute('alt');
$ret['Retail7'] = $html->find('span[class="price"]', 6)->innertext;
$ret['SoldBy7'] = $html->find('ul.sellerInformation img', 6)->getAttribute('alt');

Thank you for any suggestions!

  • 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-26T18:07:16+00:00Added an answer on May 26, 2026 at 6:07 pm

    I used a foreach and put the results into an array. Worked much better since the number of sellers varies by item.

    foreach($html->find('div.resultsset table tbody.result tr') as $article) {  
    if($article->find('span.price', 0)) {   
    // get retail   
    $item['Retail'] = $article->find('span.price', 0)->plaintext;   
    // get soldby   
    if($article->find('img', 0)->getAttribute('alt') <> '') { 
    $item['SoldBy'] = $article->find('img', 0)->getAttribute('alt'); } 
    else {$item['SoldBy'] = $article->find('ul.sellerInformation li a b', 0)->plaintext;} 
    $ret[] = $item;  
     } 
    }  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pull a project from git, in particular, this one: https://github.com/pocmo/Yaaic .
Just trying to pull off some SMART info from connected Hard Drives on any
I'm trying to pull data from the YouTube API into a local MySQL table.
I am trying to pull a specific set of records from a table called
I am trying to pull an LDAP jpegPhoto attribute from an openLDAP server using
I'm trying to pull out the sales totals for quarter 1. I can't seem
I am trying to pull in information from Asana API via JQuery.ajax() method. But
Well, I'm pretty much trying to figure out how to pull information from a
Trying to pull a value from the sunrise element from [yweather:astronomy] in the Yahoo
I am trying to pull text from various parts of a webpage and push

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.