emhart / rGtrends

An R interface for google trends.
9 stars 2 forks source link

Error: "Could not find requested section" #2

Open rnorberg opened 12 years ago

rnorberg commented 12 years ago

I'm using R version 2.14.1 and R Studio (the latest version)

My code is:

library(devtools)
library(rGtrends)
dev_mode()
rGtrends(c('cat','dog','fish'))

The error it returns is:

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : Traceback (most recent call last): File "", line 1, in File "C:/User/Documents/R-dev/rGtrends/src/pyGTrends.py", line 105, in csv raise Exception("Could not find requested section") Exception: Could not find requested section

emhart commented 12 years ago

I put your code in, and I was unable to recreate the error. I can tell that the problem is related to the python code and the section component, which parses the results by sub categories like language, etc. Do you have python installed on your machine?

emhart commented 12 years ago

I've poked around the python code a bit, and I tracked down the error to how it handles the sections from the csv that gets downloaded. Have you tried other searches as well? I may need to go in and gut some of the python code because this is built on the old formatting of the csv.

rnorberg commented 12 years ago

Yes, I do. I spent some time fooling with it and I made sure the python script it is calling is up to date with the latest version on github, but I still get the error. I'm not well versed enough in python to debug that script however. On Nov 6, 2012 2:12 AM, "Edmund Hart" notifications@github.com wrote:

I put your code in, and I was unable to recreate the error. I can tell that the problem is related to the python code and the section component, which parses the results by sub categories like language, etc. Do you have python installed on your machine?

— Reply to this email directly or view it on GitHubhttps://github.com/emhart/rGtrends/issues/2#issuecomment-10101184.

excess-kurtosis commented 11 years ago

Interesting and potentially useful code.

I'd like to find a solution too as I have the same problem:

source('~/JCP/Computer/R/Google_search.R') Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : Traceback (most recent call last): File "", line 1, in File "/home/john/R/i686-pc-linux-gnu-library/2.15/rGtrends/src/pyGTrends.py", line 105, in csv raise Exception("Could not find requested section") Exception: Could not find requested section

My R code was your MySpace, Twitter example:

library(rGtrends) my_terms <- c("Twitter", "Myspace") twit_ms <- rGtrends(my_terms) twit_ms <- twit_ms[-dim(twit_ms)[1], ] plot(twit_ms[, 1], twit_ms[, 3], type = "l", col = 2, xlab = "Date", ylab = "Search Volume", main = "Rise of Twitter and fall of Myspace") lines(twit_ms[, 1], twit_ms[, 2])

Yakito commented 11 years ago

Same error here, it looks that the recent changes to the google trends site might have mess things around. Any tip on how to solve it much appreciated

mrrgb commented 11 years ago

I got the same problem, anyone who can provide a solution~ Thanks a lot