Can't find web scraping element

I am learning PHP and have a PHP web scraper (although this question is more about the page elements than php, I think).

The web scraper scrapes all book information from an Amazon book page. But I can’t get it to scrape the book description, can anyone help me figure out what is wrong with it.

For example, for the Amazon book page here:

My php scraper script uses:

    // find description
    $description = $dom->find('#bookDescription_feature_div noscript div', 0);
$myfile = fopen("debug.txt", "w");
fwrite($myfile, $content);
    $text = trim(strip_tags(str_replace('<br />', "\n", $description->innertext)));

Ok, I finally answered my own question.

On the Amazon page, ‘noscript’ has been removed.
Therefore, when I removed it from the scraping code, the scraper began working correctly again.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.