PMassicotte / gtrendsR

R functions to perform and display Google Trends queries
352 stars 112 forks source link

Error while parallel processing using furrr #421

Closed shrikant2002 closed 2 years ago

shrikant2002 commented 2 years ago

I use furrr package to process multiple keywords & speed up the process but for some keywords I get error however I skipped those error with possibly function but I need to correct my result. Can anyone help me using this. Do I have to add any sleep function so I can proceed with all the result without any error ?

Some keywords have this error Error in start_top:end_top : NA/NaN argument

Some keywords have this error "widget$status_code == 200 is not TRUE"

dftrend <- future_map(keywords[1:length(keywords)], possibly(.f = function(x) gtrends(x,time="now 1-H", gprop="youtube"), otherwise = "error"), .progress = T)

I tried the error keyword running seperately in gtrends it works fine and produce correct result

PMassicotte commented 2 years ago

As with many APIs, if you request too much, you will likely get blocked for a while. This is not a problem related to the package, but rather on Google Trends itself.