def login(pixiv_id, password)
      doc = agent.get("https://accounts.pixiv.net/login?lang=ja&source=pc&view_type=page")
      return if doc && doc.body =~ /logout/
      form = doc.forms_with(action: '/login').first
      puts doc.body and raise Error::LoginFailed, 'login form is not available' unless form
      form.pixiv_id = pixiv_id
      form.password = password
      doc = agent.submit(form)
      raise Error::LoginFailed unless doc && doc.body =~ /logout/
      @member_id = member_id_from_mypage(doc)
    end
def login(pixiv_id, password)
      doc = agent.get("https://accounts.pixiv.net/login?lang=ja&source=pc&view_type=page")
      return if doc && doc.body =~ /logout/
      form = doc.forms_with(action: '/login').first
      puts doc.body and raise Error::LoginFailed, 'login form is not available' unless form
      form.pixiv_id = pixiv_id
      form.password = password
      doc = agent.submit(form)
      raise Error::LoginFailed unless doc && doc.body =~ /logout/
      @member_id = member_id_from_mypage(doc)
    end
A new instance of Client, logged in with the given credentials
 @overload initialize(pixiv_id, password)
   @param [String] pixiv_id
   @param [String] password
   @yield [agent] (optional) gives a chance to customize the +agent+ before logging in
 @overload initialize(agent)
   @param [Mechanize::HTTP::Agent] agent
 @return [Pixiv::Client]
 Log in to Pixiv
 @param [String] pixiv_id
 @param [String] password