Skip to content

Instantly share code, notes, and snippets.

@ericchen
Created January 22, 2015 13:07
Show Gist options
  • Save ericchen/9d76dafdbc32173184cb to your computer and use it in GitHub Desktop.
Save ericchen/9d76dafdbc32173184cb to your computer and use it in GitHub Desktop.
导入cookies文件实现自动登录

##Download chrome plugin cookietxt-export and export cookie data to cookie.txt after you login manually##

agent = Mechanize.new
agent.cookie_jar.load('cookies.txt', :cookiestxt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment