{"action":"created","issue":{"url":"https://api.github.com/repos/scrapy/scrapy/issues/1145","labels_url":"https://api.github.com/repos/scrapy/scrapy/issues/1145/labels{/name}","comments_url":"https://api.github.com/repos/scrapy/scrapy/issues/1145/comments","events_url":"https://api.github.com/repos/scrapy/scrapy/issues/1145/events","html_url":"https://github.com/scrapy/scrapy/pull/1145","id":67599376,"number":1145,"title":"[MRG+1] default return value for extract_first","user":{"login":"bosnj","id":10396664,"avatar_url":"https://avatars.githubusercontent.com/u/10396664?v=3","gravatar_id":"","url":"https://api.github.com/users/bosnj","html_url":"https://github.com/bosnj","followers_url":"https://api.github.com/users/bosnj/followers","following_url":"https://api.github.com/users/bosnj/following{/other_user}","gists_url":"https://api.github.com/users/bosnj/gists{/gist_id}","starred_url":"https://api.github.com/users/bosnj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bosnj/subscriptions","organizations_url":"https://api.github.com/users/bosnj/orgs","repos_url":"https://api.github.com/users/bosnj/repos","events_url":"https://api.github.com/users/bosnj/events{/privacy}","received_events_url":"https://api.github.com/users/bosnj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-04-10T13:47:19Z","updated_at":"2015-05-21T17:05:29Z","closed_at":"2015-05-21T17:03:54Z","pull_request":{"url":"https://api.github.com/repos/scrapy/scrapy/pulls/1145","html_url":"https://github.com/scrapy/scrapy/pull/1145","diff_url":"https://github.com/scrapy/scrapy/pull/1145.diff","patch_url":"https://github.com/scrapy/scrapy/pull/1145.patch"},"body":"It would be useful to have a default return value for `extract_first`, to avoid additional data type checks. \r\n\r\nFor example, when expecting a string, this would raise an exception:\r\n`something = selector.extract_first().lower()`\r\n\r\nAllowing an optional `default` value can solve this elegantly:\r\n`something = selector.extract_first(default='').lower()`"},"comment":{"url":"https://api.github.com/repos/scrapy/scrapy/issues/comments/104356572","html_url":"https://github.com/scrapy/scrapy/pull/1145#issuecomment-104356572","issue_url":"https://api.github.com/repos/scrapy/scrapy/issues/1145","id":104356572,"user":{"login":"dangra","id":37369,"avatar_url":"https://avatars.githubusercontent.com/u/37369?v=3","gravatar_id":"","url":"https://api.github.com/users/dangra","html_url":"https://github.com/dangra","followers_url":"https://api.github.com/users/dangra/followers","following_url":"https://api.github.com/users/dangra/following{/other_user}","gists_url":"https://api.github.com/users/dangra/gists{/gist_id}","starred_url":"https://api.github.com/users/dangra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangra/subscriptions","organizations_url":"https://api.github.com/users/dangra/orgs","repos_url":"https://api.github.com/users/dangra/repos","events_url":"https://api.github.com/users/dangra/events{/privacy}","received_events_url":"https://api.github.com/users/dangra/received_events","type":"User","site_admin":false},"created_at":"2015-05-21T17:05:29Z","updated_at":"2015-05-21T17:05:29Z","body":":beetle:juice x 3"}}