mikkelkrogsholm / Rmazon

The goal of Rmazon is to help you download product information and reviews from Amazon.com easily.
GNU General Public License v2.0
12 stars 5 forks source link

Issues in Retrieving reviews #4

Closed anantawasthi closed 7 years ago

anantawasthi commented 7 years ago

Dear Team, apart from issues share by other i am geting below mentioned issue while fetching data ( user review) from amazon.

"object cannot be coerced to type 'double'"

mikkelkrogsholm commented 7 years ago

Can you write your example?

Den 14. nov. 2016 13.48 skrev "Anant Prakash Awasthi" < notifications@github.com>:

Dear Team, apart from issues share by other i am geting below mentioned issue while fetching data ( user review) from amazon.

"object cannot be coerced to type 'double'"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/56north/Rmazon/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AMpLyEbEYQlDqM-oiOERD_9ulEbYXDb4ks5q-FiYgaJpZM4KxSEx .

anantawasthi commented 7 years ago

Hi, Thank you for a swift response.

I am submitting below mentioned code.

reviews <- Rmazon::get_reviews("8129142147") Error in Rmazon::get_reviews("8129142147", domain = "in") : (list) object cannot be coerced to type 'double'

if possible kindly provide a detailed documentation around this package. I am planning to include this package to my teaching plan to collect data from amazon for other analysis purposes. Thank you. Anant

BarkleyBG commented 7 years ago

This may or may not be similar to the issue I brought up yesterday in https://github.com/56north/Rmazon/issues/3

In fact, when I run the code that @anantgithub suggests, I get the following

library('Rmazon')

product_info <- Rmazon::get_product_info("8129142147", domain = "in") NAs introduced by coercion> reviews <- Rmazon::get_reviews("8129142147", domain = "in") Error in Rmazon::get_reviews("8129142147", domain = "in") : (list) object cannot be coerced to type 'double'

product_info $productTitle [1] "One Indian Girl" $newPrice character(0) $avgRating [1] 3.1 $histogramTable rating pct 1 5 star 516 2 4 star 306 3 3 star 244 4 2 star 183 5 1 star 473 $reviewsCount [1] NA $productDetails $productDetails[[1]]
[1] "Paperback: 280 pages" $productDetails[[2]]
[1] "Publisher: Rupa Publications India; First edition (1 October 2016)" $productDetails[[3]]
[1] "Language: English" $productDetails[[4]]
[1] "ISBN-10: 8129142147" $productDetails[[5]]
[1] "ISBN-13: 978-8129142146" $productDetails[[6]]
[1] "Product Dimensions: 13 x 1.6 x 19.8 cm"
$productDetails[[7]]
[1] "Average Customer Review: function reviewHistPingAjax() { jQuery.get(\"/gp/customer-reviews/common/du/recordHistoPopAjax.html\", null); } var reviewHistPopoverConfig = { showOnHover:true, showCloseButton: false, width:null, location:'bottom', locationAlign:'left', locationOffset:[-20,0], group: ... $productDetails[[8]]
[1] "Amazon Bestsellers Rank: 1 in Books (See Top 100 in Books) .zg_hrsr { margin: 0; padding: 0; list-style-type: none; } .zg_hrsr_item { margin: 0 0 0 10px; } .zg_hrsr_rank { display: inline-block; width: 80px; text-align: right; } 1 in Books > Literature & Fiction > Contemporary Fiction" $productDetails[[9]]
[1] "1 in Books > Literature & Fiction > Contemporary Fiction" $productDetails[[10]]
[1] "Books > Literature & Fiction > Contemporary Fiction"

reviews <- Rmazon::get_reviews("8129142147", domain = "in") Error in Rmazon::get_reviews("8129142147", domain = "in") : (list) object cannot be coerced to type 'double'

reviews Error: object 'reviews' not found

sessionInfo() R version 3.2.3 (2015-12-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] Rmazon_0.2 loaded via a namespace (and not attached): [1] httr_1.0.0 selectr_0.2-3 R6_2.1.0 magrittr_1.5 tools_3.2.3 curl_0.9.6
[7] Rcpp_0.12.7 xml2_1.0.0 stringi_1.0-1 knitr_1.14 stringr_1.1.0 rvest_0.3.2
[13] XML_3.98-1.3

mikkelkrogsholm commented 7 years ago

The problem should be fixed now. Try to reinstall and run again.