Rvest Problem On Shinyapps.io

198 views
Skip to first unread message

Gordon

unread,
Jul 21, 2016, 4:14:10 PM7/21/16
to shinyapps.io Users
Hello,

My problem is a replica of this one. I have elements of a shiny app embedded in a flexdashboard markdown file along with some webscraping with rvest. Everything works fine locally, but when I published it to shinyapps.io it gives me the following error:

could not find function "xpath_element"

Which points to an rvest issue. Does anyone know how to fix or work around this? My logs.txt file is also attached.
logs.txt

Tareef Kawaf

unread,
Jul 21, 2016, 4:17:46 PM7/21/16
to Gordon, shinyapps.io Users
Is it possible to share a small app that can reproduce the issue?  

--
You received this message because you are subscribed to the Google Groups "shinyapps.io Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/11d349b5-ffe1-42fc-8ecb-4d4b6f97b03c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Grosskopf

unread,
Jul 29, 2016, 9:16:30 PM7/29/16
to shinyapps.io Users, gora...@yahoo.com
If you deploy the template Shiny app in RStudio but add the rvest package and a call to a function from it; for instance adding:

library(rvest)

new_links <- tmp_html %>% html_nodes("a") %>% xml_attr("href")

to server.R, it will fail and the error logs show:
2016-07-30T00:23:46.131743+00:00 shinyapps[117519]: shiny version: 0.12.2
2016-07-30T00:23:46.308504+00:00 shinyapps[117519]: Starting R with process ID: '18'
2016-07-30T00:23:46.131747+00:00 shinyapps[117519]: rmarkdown version: NA
2016-07-30T00:23:46.131747+00:00 shinyapps[117519]: knitr version: NA
2016-07-30T00:23:46.131748+00:00 shinyapps[117519]: jsonlite version: 0.9.17
2016-07-30T00:23:46.131748+00:00 shinyapps[117519]: RJSONIO version: NA
2016-07-30T00:23:46.131748+00:00 shinyapps[117519]: htmltools version: 0.2.6
2016-07-30T00:23:46.305438+00:00 shinyapps[117519]: Using jsonlite for JSON processing
2016-07-30T00:23:46.312912+00:00 shinyapps[117519]: Listening on http://0.0.0.0:55910
2016-07-30T00:23:46.413075+00:00 shinyapps[117519]: Loading required package: xml2
2016-07-30T00:23:49.635010+00:00 shinyapps[117519]: Error in do.call(method, list(parsed_selector)) : 
2016-07-30T00:23:49.635015+00:00 shinyapps[117519]:   could not find function "xpath_element"


Joshua Spiewak

unread,
Jul 29, 2016, 11:06:57 PM7/29/16
to shinyapps.io Users, gora...@yahoo.com
Perhaps updating to the latest versions of packages will help? I copied those three lines and saw no error:

2016-07-30T03:03:34.180570+00:00 shinyapps[88391]: shiny version: 0.13.2
2016-07-30T03:03:34.180573+00:00 shinyapps[88391]: rmarkdown version: NA
2016-07-30T03:03:34.180573+00:00 shinyapps[88391]: knitr version: NA
2016-07-30T03:03:34.180573+00:00 shinyapps[88391]: jsonlite version: 0.9.20
2016-07-30T03:03:34.180574+00:00 shinyapps[88391]: RJSONIO version: NA
2016-07-30T03:03:34.180574+00:00 shinyapps[88391]: htmltools version: 0.3.5
2016-07-30T03:03:34.331126+00:00 shinyapps[88391]: Using jsonlite for JSON processing
2016-07-30T03:03:34.336425+00:00 shinyapps[88391]:
2016-07-30T03:03:34.336427+00:00 shinyapps[88391]: Starting R with process ID: '17'
2016-07-30T03:03:34.352213+00:00 shinyapps[88391]:
2016-07-30T03:03:34.352216+00:00 shinyapps[88391]: Listening on http://0.0.0.0:52631
2016-07-30T03:03:37.300123+00:00 shinyapps[88391]: Loading required package: xml2

Michael Grosskopf

unread,
Jul 30, 2016, 12:34:24 PM7/30/16
to shinyapps.io Users, gora...@yahoo.com
Updating the package and it's dependencies alone didn't work, but updating to R 3.3.1 and having updated all packages did. Thank you very much for the quick reply.

Gordon

unread,
Jul 30, 2016, 2:05:40 PM7/30/16
to shinyapps.io Users
Hi,

Sorry for the absence of a response. I fixed the problem by updating R and all the packages.
Reply all
Reply to author
Forward
0 new messages