{"action":"opened","issue":{"url":"https://api.github.com/repos/istresearch/scrapy-cluster/issues/188","repository_url":"https://api.github.com/repos/istresearch/scrapy-cluster","labels_url":"https://api.github.com/repos/istresearch/scrapy-cluster/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/istresearch/scrapy-cluster/issues/188/comments","events_url":"https://api.github.com/repos/istresearch/scrapy-cluster/issues/188/events","html_url":"https://github.com/istresearch/scrapy-cluster/issues/188","id":336671694,"node_id":"MDU6SXNzdWUzMzY2NzE2OTQ=","number":188,"title":"Add login in LinkSpider","user":{"login":"seelixe","id":15314417,"node_id":"MDQ6VXNlcjE1MzE0NDE3","avatar_url":"https://avatars1.githubusercontent.com/u/15314417?v=4","gravatar_id":"","url":"https://api.github.com/users/seelixe","html_url":"https://github.com/seelixe","followers_url":"https://api.github.com/users/seelixe/followers","following_url":"https://api.github.com/users/seelixe/following{/other_user}","gists_url":"https://api.github.com/users/seelixe/gists{/gist_id}","starred_url":"https://api.github.com/users/seelixe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seelixe/subscriptions","organizations_url":"https://api.github.com/users/seelixe/orgs","repos_url":"https://api.github.com/users/seelixe/repos","events_url":"https://api.github.com/users/seelixe/events{/privacy}","received_events_url":"https://api.github.com/users/seelixe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-28T15:30:25Z","updated_at":"2018-06-28T15:30:25Z","closed_at":null,"author_association":"NONE","body":"Hello ! i want to create my own spider with the function to simulate an user login. But i don't understand this init: \r\n```\r\ndef __init__(self, *args, **kwargs):\r\nsuper(LinkSpider, self).__init__(*args, **kwargs)\r\n```\r\n\r\nHow to had the login system with LinkSpider ?\r\nHere is my beginning code... Do you think I can fit it in?\r\n\r\n```\r\n    # Temp\r\n    login_page = 'https://url/'\r\n    email = 'mail'\r\n    password = 'pwd'\r\n\r\n    def __init__(self, *args, **kwargs):\r\n        super(LinkSpider, self).__init__(*args, **kwargs)\r\n\r\n    def init_request(self):\r\n        return Request(url=self.login_page, callback=self.login)\r\n\r\n    def login(self, response):\r\n        return FormRequest.from_response(response,\r\n                                         formdata={'session_key': 'email', 'session_password': 'password'},\r\n                                         callback=self.check_login_response)\r\n\r\n    def check_login_response(self, response):\r\n        if \"Sign Out\" in response.body:\r\n            self._logger.debug(\"Successfully logged in. Let's start crawling!\")\r\n            return self.initialized()\r\n\r\n        else:\r\n            self._logger.debug(\"Failed, bad times.\")\r\n\r\n    def parse(self, response):\r\n        self._logger.debug(\"crawled url {}\".format(response.request.url))\r\n        cur_depth = 0\r\n\r\n```\r\nThanks :+1: \r\n\r\n"}}
{"actor":{"display_login":"seelixe"}}