+ def _real_initialize(self):
+ email, password = self._get_login_info()
+ if email is None:
+ return
+
+ webpage = self._download_webpage(self._LOGIN_URL, None)
+ form = self._search_regex(
+ r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
+ webpage, 'login form')
+ data = self._hidden_inputs(form)
+ data.update({
+ 'Email': email,
+ 'Password': password,
+ })
+ self._download_webpage(
+ self._LOGIN_URL, None, 'Logging in', data=urlencode_postdata(data))
+