-2

I wanted to get the html of search yahoo search result using R code like below. If its google it would be like

siteHTML<-getForm("google.com/search",hl="en",q="keyword",btnG="Search")

In case of yahoo I could find the keyword search tag should be "p" instead of "q". But I cannot find what i shoud put instead of "btnG". It seems like btnG refers to the search button name. I went through the html code of yahoo search but could not find the the search button "name".Without it I cannot get the search result. If anybody knows can you please help me!

Thomas
  • 43,637
  • 12
  • 109
  • 140

1 Answers1

0

With a little work you could figure this out on your own. Try searching for something on yahoo and pull apart the URL to its core elements: http://search.yahoo.com/search?p=keyword

With that, you'll see you can just do:

library(RCurl)
siteHTML<-getForm("http://search.yahoo.com/search",p="keyword")
Thomas
  • 43,637
  • 12
  • 109
  • 140
  • Now that I see your answer it seems really easy. I am even wondering why I could not figure it out spending such a time. Thank you very much! – user1639961 Nov 17 '13 at 02:49