[r-crawling] 실습: 쿠키를 이용한 온오프믹스 로그인
library(httr)
res = POST('http://onoffmix.com/account/login',
body = list(
proc = 'login',
returnUrl = 'http://onoffmix.com',
email = '<아이디>',
pw = "<비밀번호>"
))
session = set_cookies(.cookies = unlist(cookies(res)))
res = GET('http://onoffmix.com', session)
library(rvest)
h = read_html(res)
menu = html_nodes(h, 'ul.serviceMenu')
menu.text = html_text(menu)
repair_encoding(menu.text)