【发布时间】:2017-01-26 15:54:13
【问题描述】:
目前,我通过评论链接获取亚马逊客户评论的方式是使用
通过提供评论链接,我可以获取评论内容,例如 标题、评分、评论、描述、图片、视频、作者等。
如果我知道每个内容的css selector,这一切都是可能的。
向您展示我是如何做到的:
$url = 'REVIEW_URL_HERE';
$html = file_get_html($url,false); //see PHP Simple HTML DOM Parser
$testSelector='#SAMPLE-SELECTOR';
$content = $html->find($testSelector, 0)->plaintext;
//echo $content; //error-> seems selector is not present.
echo $html; // i expect the review link page will be loaded. but the loaded page is different
输出意外。因为我echo $html,我期待评论页面。但显示了不同的页面:
我用来获取评论内容的方法似乎不再可行。新方法的任何想法? 我发现 AWS 关于获取评论...但 AFAIK 它不返回评论内容..它只返回评论链接..
【问题讨论】:
标签: php amazon simple-html-dom review amazon-product-api