0

I need to use a HTML website from R. The website is http://soundoftext.com/. This website allows to download MP3 audio from a word in a given language. I would like to download this file from R by selecting the language and word.

I have experience on parsing XML files but not HTML. So far, I got the tree structure but I don't know how to parse HTML files obtaining the "tags" to POST my values.

require(RCurl)
require(XML)
webpage <- getURL("http://soundoftext.com/")
webpage <- readLines(tc <- textConnection(webpage)); close(tc)
pagetree <- htmlTreeParse(webpage, error=function(...){}, useInternalNodes = TRUE)
R user
  • 11
  • 4
  • `xmlToList(pagetree)` returns a list and you can access the elements – Jean Jan 25 '17 at 10:10
  • It works. I've modified the parameters. How can submit the list with the values modified? – R user Jan 25 '17 at 10:43
  • You want to post the xml? As far as i recall, there is no `listToXML` function, you have to recreate xml... here's a link http://stackoverflow.com/questions/6256064/how-to-create-xml-from-r-objects-e-g-is-there-a-listtoxml-function after that you can use `httr` package to post it – Jean Jan 26 '17 at 02:08

0 Answers0