Description Usage Arguments Value See Also Examples
Execute a custom rendering script and return a result.
1 2 | execute_lua(splash_obj, lua_source, timeout = 30, allowed_domains, proxy,
filters, save_args, load_args)
|
splash_obj |
Object created by a call to |
lua_source |
Browser automation script. See Splash Script Tutorial for more info. |
timeout |
A timeout (in seconds) for the render (defaults to 30). Without reconfiguring the startup parameters of the Splash server (not this package) the maximum allowed value for the timeout is 60 seconds. |
allowed_domains |
Comma-separated list of allowed domain names. If present, Splash won’t load anything neither from domains not in this list nor from subdomains of domains not in this list. |
proxy |
Proxy profile name or proxy URL. |
filters |
Comma-separated list of request filter names. |
save_args |
A list of argument names to put in cache. |
load_args |
Parameter values to load from cache |
raw
content from the httr
call. Given the vast diversity of possible return
values, it's up to the caller to handle the return value.
Other splash_renderers: render_har
,
render_html
, render_jpeg
,
render_json
, render_png
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
splash_local %>%
execute_lua('
function main(splash)
splash:go("https://projects.fivethirtyeight.com/congress-trump-score/")
splash:wait(0.5)
return splash:evaljs("memberScores")
end
') -> res
rawToChar(res) %>%
jsonlite::fromJSON(flatten=TRUE) %>%
purrr::map(tibble::as_tibble) -> member_scores
member_scores
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.