Exporting open tabs to Opasnet
Jump to navigation
Jump to search
| Moderator:Jouni (see all) |
| This page is a stub. You may improve it into a full page. |
| Upload data
|
Question
How to export open tabs to Opasnet?
Answer
Often when you have performed a search about a topic, you have a lot of tabs open, and you'd like to have an easy way to export all those to an Opasnet page as links. This is how to do it.
- Organise tabs on a web browser (Firefox) so that all that you want to save are on one window.
- On that browser window, right-click a tab and "Select all tabs".
- Right-click again "Bookmark tabs". Save them in a temporary folder.
- Go to Bookmarks >> Import and Backup >> Export Bookmarks to HTML... and save the bookmarks to ~/bookmarks.html (note that ALL bookmarks will be exported, not only the active folder)
- Run the following code in R.
- Open temp.csv from your home folder and copy-paste the links you want to Opasnet
- Remove the temporary folder from bookmarks and the two temporary files created.
library(xml2)
library(rvest)
tst <- html_nodes(read_html("~/bookmarks.html", options="HUGE"), css="a")
out <- data.frame(
ref=html_attr(tst, name="href"),
name=html_text(tst)
)
out$out <- paste0("* [", out$ref, " ", out$name, "]")
write_csv(out[3], "~/temp.csv")