統計解析R たぶんpart3くらい (587レス)
前次1-
抽出解除 必死チェッカー(本家) (べ) 自ID レス栞 あぼーん

リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
259: 2019/03/21(木)23:21 ID:2X9Nl1zM(1) AAS
わかる人が来るまでのつなぎ - 30年以内に来ればラッキーだと思うけど
* ['rvest::html' is deprecated, but rvest::read_html doesn't exist. Issue #191 tidyverse/rvest GitHub](外部リンク:github.com
* [rvest package | R Documentation](外部リンク:www.rdocumentation.org
``` {r}
with (list (`%>%` = purrr::`%>%`, size = length, null = NULL), {
home = '外部リンク:stackoverflow.com';
depth = 0;
done = list ();
todo = list ('/questions/28863775/scraping-linked-html-webpages-by-looping-the-rvestfollow-link-function');
while (0 < size (todo) & depth < 2) {
depth = depth + 1;
done = c (done, todo);
todo = purrr::reduce (.init = null, .x = todo, .f = function (out, path) {
url = paste0 (home, path);
text = xml2::read_html (url);
nodes = rvest::html_nodes (text, css = '.related a.question-hyperlink');
purrr::reduce (.init = out, .x = nodes, function (out, node) {
path = rvest::html_attr (node, 'href');
if (path %in% done) {
cat ('what a small world:', path, '\n');
out;
} else {
cat ('i am going to stalk:', rvest::html_text (node), '\n');
c (out, path);
}
});
});
}
});
```
前次1-
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 0.026s