Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Error: "Could not find requested section" #2

Open
rnorberg opened this Issue Oct 22, 2012 · 6 comments

Comments

Projects
None yet
5 participants

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

Owner

emhart commented Nov 6, 2012

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?

Owner

emhart commented Nov 6, 2012

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 Nov 6, 2012

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.

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 Dec 8, 2012

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 Feb 1, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment