I want to fetch book information like author, image ISBN 10, ISBN 13 by providing ISBN. Also, i would like to fetch the buyback price of the book.
It looks like one of the only reasonable things that I've seen so far, for the Amazon API. Is there a free and easy way to get numerous ASINs, or see what an ASINs ISBN/UPC is? The code I found on this website ( BraveChoices ) did not produce any results (just a blank page.) I honestly don't much about PHP or else I'd debug it myself. <?php // Which Amazon URL to scrape? $base_url = "http://www.amazon.com/s/ref=sr_nr_p_n_feature_keywords_3?rh=n%3A228013%2Cn%3A!468240%2Cn%3A328182011%2Cn%3A551236%2Cn%3A552660%2Cp_n_feature_keywords_two_browse-bin%3A7065982011|7065983011|7065984011&bbn=552660&ie=UTF8&qid=1409504427&rnid=5909567011"; // How many pages to scrape? $total_pages = 3; // Require the Simple HTML DOM library require_once("simple_html_dom.php"); // Initiate the page count $page = 1; // Open the ASINs file for writing $handle = fopen("asins.txt", "w"); // Start looping through the pages, starting from 1 and stopping to $total_pages while ($page <= $total_pages) { // Make paged URL of the Amazon.com category page $url = "$base_url&page=$page"; // Fetch it with cURL $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIESESSION, true ); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt" ); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt" ); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"); $curl_scraped_page = curl_exec($ch); // Parse the fetched page with Simple HTML DOM $html = new simple_html_dom(); $html->load($curl_scraped_page); // Start looping through products foreach($html->find("div.prod") as $item) { // Get ASIN from the scraped HTML $asin = $item->name; // Write the ASIN to the ASIN file fwrite($handle, "$asin\n"); // End of product } // Increment page variable by one $page++; // End of page } // Clear the HTML object $html->clear(); // Close the ASINs file fclose($handle); ?> PHP: It looks like maybe Amazon doesn't use a div class of "prod" to display these things anymore.