Created
March 14, 2017 06:22
-
-
Save wppurking/ad2ab00917e6dec32ffeb5ad1a1b9ad1 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": "0068fbe3-bd16-43d5-bfe1-cd0a940fd013", | |
"url": "https://www.amazon.es/product-reviews/B01G1D7ID6/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('Compra verificada') >= 0" | |
}, | |
{ | |
"key": "create_time", | |
"value": "div//span[contains(@class, 'review-date')]/text()", | |
"script": "date_format('es', '_value_', 'el 2 de January de 2006')" | |
}, | |
{ | |
"key": "rating", | |
"value": "div//i[contains(@class, 'review-rating')]/span/text()", | |
"script": "'_value_'.split(' de ')[0].replace(',', '.')" | |
}, | |
{ | |
"key": "helpful", | |
"value": "descendant::div[contains(@class, 'review-comments')]/descendant::span[contains(@class, 'review-votes')]", | |
"script": "var votes = '_value_'.replace('A ', ''); votes.indexOf('una') >= 0 ? '1' : votes.split(' personas')[0]" | |
} | |
] | |
}, | |
{ | |
"scope_rule": "//*[@id='cm_cr-pagination_bar']", | |
"kv_rule": [ | |
{ | |
"key": "has_next", | |
"value": "descendant::li[@class=\"a-last\"]/a/text()", | |
"script": "'_value_'.indexOf('Siguiente') >= 0" | |
} | |
] | |
}, | |
{ | |
"scope_rule": "//div[contains(@class, 'page-content')][1]", | |
"kv_rule": [ | |
{ | |
"key": "total_review_count", | |
"value": "//span[contains(@class, 'totalReviewCount')]" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"tid": "017a1d96-cc8a-47d5-94fe-851d121c1f49", | |
"url": "https://www.amazon.es/review/R12VK8051EHLNV/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(' de ')[0]).toString()" | |
}, | |
{ | |
"key": "verified", | |
"value": "descendant::span[contains(@class, 'crVerifiedStripe')]", | |
"script": "'_value_'.indexOf('Compra verificada') >= 0" | |
}, | |
{ | |
"key": "rating", | |
"value": "div/div/span/img/@title", | |
"script": "'_value_'.split(' de un ')[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('es', '_value_', '2 de January de 2006')" | |
} | |
] | |
}, | |
{ | |
"scope_rule": "//table//td[contains(@class, 'crTanBorder-tc')]", | |
"kv_rule": [ | |
{ | |
"key": "is_delete", | |
"value": "//div[contains(@class, 'crLargerTitle')]", | |
"script": "'_value_'.indexOf(\"Lo sentimos, el sistema de comentarios\") >= 0" | |
} | |
] | |
} | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment