rstudio / webshot2

Take screenshots of web pages from R

Home Page:https://rstudio.github.io/webshot2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webshot2::webshot doesnt return from being called

SatoshiReport opened this issue · comments

I run webshot about 1,000 times a day and every few days I don't get a return status. I have to restart my program as there is no way that I know off to get around this. Is there options I can use to help debug this?

Can you provide more detailed information? Like what are you taking a screenshot of, and what exactly does you mean by "I don't get a return status?"

@SatoshiReport , Are you running appshot or webshot? If you're running appshot you may want to look at (#19), which enables detection and forwarding of errors in the app-running background process. This can make debugging these mysterious no return calls easier.

Hi, I also have a similar problem when trying to call webshot2 from the flextable package. I tried to capture the bug using reprex but it didn't work. Below is a minimal example:

library(dplyr)
library(flextable)

ft <- iris %>%
group_by(Species) %>%
summarise_all(median) %>%
flextable()

ft_ws2 <- as_raster(ft, webshot="webshot2")

The code worked for the first time but when I tried again, the R was stuck at the last step like forever. It worked if I set webshot="webshot". Not sure if this is a webshot2 or flextable problem.

update: I confirmed that I could run the code ft_ws2 <- as_raster(ft, webshot="webshot2") in a new R session. But if I run the code again in the same R session, then R runs the code forever. I need to assign a new variable name to make it work. R is also stuck when I render the code in RMarkdown.

I think this may be fixed by rstudio/chromote@e423b4b

And it may also need the fix here: #21

After updating the webshot2, I could repeatedly run the code from R console. However, when I try to knit the RMarkdown file, I got an error message saying: Error: Chromote: timed out waiting for event Page.loadEventFired. I got this error message when I ran the code from R console for the first time but disappeared when I ran the code again.

@yanxianl : Could you clarify which versions you were using? You may need webshot2 from my PR as well as the latest chromote update. You'll get both of those using

remotes::install_github(c("rstudio/chromote",
                      "dmurdoch/webshot2@fixlockup"))

The webshot2 version was 0.0.0.9000 (RemoteSha@f62e743). I updated the webshot2 to @fixlockup and it worked! Now I can knit the RMarkdown file. Thanks!