login to mediawiki using RCurl
问题 how can I login to a mediawiki with RCurl (or Curl, and I can adapt it to the R package)? I just want to parse a page but I need to login otherwise I can't access it. 回答1: The Mediawiki API has a login function which returns cookies and a token. You have to save and send both back to the API in order to authenticate the session and login. Here's a way to do it with curl and XMLstarlet in bash: Send a request for a login token, saving the cookies in cookies.txt and the output in output.xml.