Created
March 14, 2017 06:21
-
-
Save wppurking/9ce06d1206e05df1e68e46fd894b7f22 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"tid": "0162d346-dae0-40a3-b0c3-8aa1fa312870", | |
"url": "https://www.amazon.de/product-reviews/B01I94NJ1U/ref=cm_cr_arp_d_viewopt_srt?ie=UTF8&filterByStar=all_stars&pageNumber=1&pageSize=50&sortBy=recent", | |
"callback": "http://44c74ebf.ngrok.io/api/v1/echo", | |
"rules": [ | |
{ | |
"scope_rule": "//*[@id='cm_cr-review_list']/div[contains(@class,'review')]", | |
"kv_rule": [ | |
{ | |
"key": "review_id", | |
"value": "@id" | |
}, | |
{ | |
"key": "asin", | |
"value": "descendant::div/a[contains(@class, 'review-title')]/@href", | |
"script": "'_value_'.split('ASIN=')[1]" | |
}, | |
{ | |
"key": "variation_asin", | |
"value": "descendant::div[contains(@class, 'review-data')]/a[contains(@class, 'a-link-normal')]/@href", | |
"script": "'_value_'.split('/ref=')[0].split('-reviews/')[1]" | |
}, | |
{ | |
"key": "title", | |
"value": "div/a[contains(@class,'review-title')]/text()", | |
"script": "'_value_'.trim()" | |
}, | |
{ | |
"key": "description", | |
"value": "div/span[contains(@class,'review-text')]/text()", | |
"script": "'_value_'.trim()" | |
}, | |
{ | |
"key": "reviewer", | |
"value": "div/span[contains(@class,'review-byline')]/a/text()" | |
}, | |
{ | |
"key": "reviewer_id", | |
"value": "descendant::span[contains(@class, 'review-byline')]/a[contains(@class, 'author')]/@href", | |
"script": "'_value_'.split('profile/')[1].split('/ref')[0]" | |
}, | |
{ | |
"key": "images", | |
"value": "div[contains(@class,'review-image-container')]/div/img/@src" | |
}, | |
{ | |
"key": "comments", | |
"value": "descendant::div[contains(@class, 'review-comments')]/descendant::span[@class='review-comment-total']" | |
}, | |
{ | |
"key": "hof", | |
"value": "descendant::a[contains(@class, 'c7y-badge-hall-of-fame')]/span/text()" | |
}, | |
{ | |
"key": "top", | |
"value": "descendant::span[contains(@class,'c7y-badge-text')]/text()" | |
}, | |
{ | |
"key": "verified", | |
"value": "div[contains(@class, 'review-data')]/span//span[contains(@class, 'a-color-state')]/text()", | |
"script": "'_value_'.indexOf('Verifizierter Kauf') >= 0" | |
}, | |
{ | |
"key": "create_time", | |
"value": "div//span[contains(@class, 'review-date')]/text()", | |
"script": "date_format('de', '_value_', 'am 2. January 2006')" | |
}, | |
{ | |
"key": "rating", | |
"value": "div//i[contains(@class, 'review-rating')]/span/text()", | |
"script": "'_value_'.split(' von ')[0].replace(',', '.')" | |
}, | |
{ | |
"key": "helpful", | |
"value": "descendant::div[contains(@class, 'review-comments')]/descendant::span[contains(@class, 'review-votes')]", | |
"script": "var votes = '_value_'; votes.indexOf('Eine') >= 0 ? '1' : votes.split(' Personen')[0]" | |
} | |
] | |
}, | |
{ | |
"scope_rule": "//*[@id='cm_cr-pagination_bar']", | |
"kv_rule": [ | |
{ | |
"key": "has_next", | |
"value": "descendant::li[@class=\"a-last\"]/a/text()", | |
"script": "'_value_'.indexOf('Weiter') >= 0" | |
} | |
] | |
}, | |
{ | |
"scope_rule": "//div[contains(@class, 'page-content')][1]", | |
"kv_rule": [ | |
{ | |
"key": "total_review_count", | |
"value": "//span[contains(@class, 'totalReviewCount')]" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"tid": "00311051-03c0-417a-8c1b-b8b1f40d1c9b", | |
"url": "https://www.amazon.de/review/R18WLOD83HD27E/ref=cm_cr_rdp_perm?ie=UTF8", | |
"callback": "http://44c74ebf.ngrok.io/api/v1/review", | |
"rules": [ | |
{ | |
"scope_rule": "/html/body/table/descendant::tr[1]/td[1]", | |
"kv_rule": [ | |
{ | |
"key": "review_id", | |
"value": "descendant::a[1]/@name" | |
}, | |
{ | |
"key": "title", | |
"value": "div/div/nobr/preceding-sibling::b/text()", | |
"script": "'_value_'.trim()" | |
}, | |
{ | |
"key": "description", | |
"value": "descendant::div[contains(@class,'reviewText')]/text()", | |
"script": "'_value_'.trim()" | |
}, | |
{ | |
"key": "images", | |
"value": "descendant::img[contains(@class, 'review-image-thumbnail')]/@src" | |
}, | |
{ | |
"key": "reviewer", | |
"value": "div/div/div/div/a/span/text()" | |
}, | |
{ | |
"key": "helpful", | |
"value": "div/div[1]/text()", | |
"script": "Number('_value_'.split(' von ')[0]).toString()" | |
}, | |
{ | |
"key": "verified", | |
"value": "descendant::span[contains(@class, 'crVerifiedStripe')]", | |
"script": "'_value_'.indexOf('Verifizierter') >= 0" | |
}, | |
{ | |
"key": "rating", | |
"value": "div/div/span/img/@title", | |
"script": "'_value_'.split(' von ')[0]" | |
}, | |
{ | |
"key": "comments", | |
"value": "//div[contains(@class, 'cdPageSelectorHeader')]/div[contains(@class, 'cdPageInfo')]", | |
"script": "'_value_'.trim().split(' von ')[1].split(' Disku')[0]" | |
}, | |
{ | |
"key": "create_time", | |
"value": "div/div/nobr/text()", | |
"script": "date_format('de', '_value_', '2. January 2006')" | |
} | |
] | |
}, | |
{ | |
"scope_rule": "//table//td[contains(@class, 'crTanBorder-tc')]", | |
"kv_rule": [ | |
{ | |
"key": "is_delete", | |
"value": "//div[contains(@class, 'crLargerTitle')]", | |
"script": "'_value_'.indexOf(\"Es tut uns leid! Das Rezensionssystem\") >= 0" | |
} | |
] | |
} | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment