This is not a trivial task as most browser produce garbage when printing to pdf. Also screenshots do not help so much with multipage threads. “Unroll” also doesn’t work reliable.
So I have been using the archive.today plugin before producing the pdf, but this method is time consuming as it needs a captcha.
Having now Selenium running in a docker container, there is a more convenient solution where just two lines of R are sufficient
remDr$navigate("https://twitter.com/SZ_Muenchen/status/1346425350394236930") remDr$screenshot(file = 'screen.png')
Login is also possible as explained at github…
username <- remDr$findElement(using = "name", value = "session[username_or_email]") username$sendKeysToElement(list("XXX")) passwd <- remDr$findElement(using = "name", value = "session[password]") passwd$sendKeysToElement(list("XXX", "\uE007"))