{"action":"created","comment":{"url":"https://api.github.com/repos/scrapy/parsel/pulls/comments/89677795","pull_request_review_id":10220488,"id":89677795,"diff_hunk":"@@ -93,13 +93,16 @@ def re(self, regex):\n         \"\"\"\n         return flatten([x.re(regex) for x in self])\n \n-    def re_first(self, regex):\n+    def re_first(self, regex, default=None):\n         \"\"\"\n         Call the ``.re()`` method for the first element in this list and\n-        return the result in an unicode string.\n+        return the result in an unicode string. If the list is empty or the\n+        regex doesn't match anything, return the default value.","path":"parsel/selector.py","position":null,"original_position":10,"commit_id":"5b158731b9d229989bd87ed1be57f6ed4ee4983c","original_commit_id":"541a25b56865188aa89f952ad5c8d7ad4936e289","user":{"login":"stummjr","id":1170435,"avatar_url":"https://avatars.githubusercontent.com/u/1170435?v=3","gravatar_id":"","url":"https://api.github.com/users/stummjr","html_url":"https://github.com/stummjr","followers_url":"https://api.github.com/users/stummjr/followers","following_url":"https://api.github.com/users/stummjr/following{/other_user}","gists_url":"https://api.github.com/users/stummjr/gists{/gist_id}","starred_url":"https://api.github.com/users/stummjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stummjr/subscriptions","organizations_url":"https://api.github.com/users/stummjr/orgs","repos_url":"https://api.github.com/users/stummjr/repos","events_url":"https://api.github.com/users/stummjr/events{/privacy}","received_events_url":"https://api.github.com/users/stummjr/received_events","type":"User","site_admin":false},"body":"Alright, just updated the PR. Thanks, @kmike !","created_at":"2016-11-26T20:43:43Z","updated_at":"2016-11-26T20:43:43Z","html_url":"https://github.com/scrapy/parsel/pull/74#discussion_r89677795","pull_request_url":"https://api.github.com/repos/scrapy/parsel/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/scrapy/parsel/pulls/comments/89677795"},"html":{"href":"https://github.com/scrapy/parsel/pull/74#discussion_r89677795"},"pull_request":{"href":"https://api.github.com/repos/scrapy/parsel/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/scrapy/parsel/pulls/74","id":95376154,"html_url":"https://github.com/scrapy/parsel/pull/74","diff_url":"https://github.com/scrapy/parsel/pull/74.diff","patch_url":"https://github.com/scrapy/parsel/pull/74.patch","issue_url":"https://api.github.com/repos/scrapy/parsel/issues/74","number":74,"state":"open","locked":false,"title":"[MRG+1] Add default parameter to re_first() method","user":{"login":"stummjr","id":1170435,"avatar_url":"https://avatars.githubusercontent.com/u/1170435?v=3","gravatar_id":"","url":"https://api.github.com/users/stummjr","html_url":"https://github.com/stummjr","followers_url":"https://api.github.com/users/stummjr/followers","following_url":"https://api.github.com/users/stummjr/following{/other_user}","gists_url":"https://api.github.com/users/stummjr/gists{/gist_id}","starred_url":"https://api.github.com/users/stummjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stummjr/subscriptions","organizations_url":"https://api.github.com/users/stummjr/orgs","repos_url":"https://api.github.com/users/stummjr/repos","events_url":"https://api.github.com/users/stummjr/events{/privacy}","received_events_url":"https://api.github.com/users/stummjr/received_events","type":"User","site_admin":false},"body":"This adds a `default` parameter to the `re_first` method, whose value is returned when the method can't extract anything.\r\n\r\n`extract_first()` already supports this parameter and it would be nice to have the same behavior for `re_first`.","created_at":"2016-11-26T16:39:28Z","updated_at":"2016-11-26T20:43:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1a8fdb54ef6bc8d17741cb36246374ac61b0a9e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scrapy/parsel/pulls/74/commits","review_comments_url":"https://api.github.com/repos/scrapy/parsel/pulls/74/comments","review_comment_url":"https://api.github.com/repos/scrapy/parsel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scrapy/parsel/issues/74/comments","statuses_url":"https://api.github.com/repos/scrapy/parsel/statuses/5b158731b9d229989bd87ed1be57f6ed4ee4983c","head":{"label":"stummjr:refirst-default","ref":"refirst-default","sha":"5b158731b9d229989bd87ed1be57f6ed4ee4983c","user":{"login":"stummjr","id":1170435,"avatar_url":"https://avatars.githubusercontent.com/u/1170435?v=3","gravatar_id":"","url":"https://api.github.com/users/stummjr","html_url":"https://github.com/stummjr","followers_url":"https://api.github.com/users/stummjr/followers","following_url":"https://api.github.com/users/stummjr/following{/other_user}","gists_url":"https://api.github.com/users/stummjr/gists{/gist_id}","starred_url":"https://api.github.com/users/stummjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stummjr/subscriptions","organizations_url":"https://api.github.com/users/stummjr/orgs","repos_url":"https://api.github.com/users/stummjr/repos","events_url":"https://api.github.com/users/stummjr/events{/privacy}","received_events_url":"https://api.github.com/users/stummjr/received_events","type":"User","site_admin":false},"repo":{"id":63997903,"name":"parsel","full_name":"stummjr/parsel","owner":{"login":"stummjr","id":1170435,"avatar_url":"https://avatars.githubusercontent.com/u/1170435?v=3","gravatar_id":"","url":"https://api.github.com/users/stummjr","html_url":"https://github.com/stummjr","followers_url":"https://api.github.com/users/stummjr/followers","following_url":"https://api.github.com/users/stummjr/following{/other_user}","gists_url":"https://api.github.com/users/stummjr/gists{/gist_id}","starred_url":"https://api.github.com/users/stummjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stummjr/subscriptions","organizations_url":"https://api.github.com/users/stummjr/orgs","repos_url":"https://api.github.com/users/stummjr/repos","events_url":"https://api.github.com/users/stummjr/events{/privacy}","received_events_url":"https://api.github.com/users/stummjr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stummjr/parsel","description":"Parsel lets you extract data from XML/HTML documents using XPath or CSS selectors","fork":true,"url":"https://api.github.com/repos/stummjr/parsel","forks_url":"https://api.github.com/repos/stummjr/parsel/forks","keys_url":"https://api.github.com/repos/stummjr/parsel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stummjr/parsel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stummjr/parsel/teams","hooks_url":"https://api.github.com/repos/stummjr/parsel/hooks","issue_events_url":"https://api.github.com/repos/stummjr/parsel/issues/events{/number}","events_url":"https://api.github.com/repos/stummjr/parsel/events","assignees_url":"https://api.github.com/repos/stummjr/parsel/assignees{/user}","branches_url":"https://api.github.com/repos/stummjr/parsel/branches{/branch}","tags_url":"https://api.github.com/repos/stummjr/parsel/tags","blobs_url":"https://api.github.com/repos/stummjr/parsel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stummjr/parsel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stummjr/parsel/git/refs{/sha}","trees_url":"https://api.github.com/repos/stummjr/parsel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stummjr/parsel/statuses/{sha}","languages_url":"https://api.github.com/repos/stummjr/parsel/languages","stargazers_url":"https://api.github.com/repos/stummjr/parsel/stargazers","contributors_url":"https://api.github.com/repos/stummjr/parsel/contributors","subscribers_url":"https://api.github.com/repos/stummjr/parsel/subscribers","subscription_url":"https://api.github.com/repos/stummjr/parsel/subscription","commits_url":"https://api.github.com/repos/stummjr/parsel/commits{/sha}","git_commits_url":"https://api.github.com/repos/stummjr/parsel/git/commits{/sha}","comments_url":"https://api.github.com/repos/stummjr/parsel/comments{/number}","issue_comment_url":"https://api.github.com/repos/stummjr/parsel/issues/comments{/number}","contents_url":"https://api.github.com/repos/stummjr/parsel/contents/{+path}","compare_url":"https://api.github.com/repos/stummjr/parsel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stummjr/parsel/merges","archive_url":"https://api.github.com/repos/stummjr/parsel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stummjr/parsel/downloads","issues_url":"https://api.github.com/repos/stummjr/parsel/issues{/number}","pulls_url":"https://api.github.com/repos/stummjr/parsel/pulls{/number}","milestones_url":"https://api.github.com/repos/stummjr/parsel/milestones{/number}","notifications_url":"https://api.github.com/repos/stummjr/parsel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stummjr/parsel/labels{/name}","releases_url":"https://api.github.com/repos/stummjr/parsel/releases{/id}","deployments_url":"https://api.github.com/repos/stummjr/parsel/deployments","created_at":"2016-07-23T03:53:43Z","updated_at":"2016-07-23T03:53:44Z","pushed_at":"2016-11-26T20:43:01Z","git_url":"git://github.com/stummjr/parsel.git","ssh_url":"git@github.com:stummjr/parsel.git","clone_url":"https://github.com/stummjr/parsel.git","svn_url":"https://github.com/stummjr/parsel","homepage":"","size":361,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scrapy:master","ref":"master","sha":"08a11b5971a89dc414c2aba738473c0bdd202326","user":{"login":"scrapy","id":733635,"avatar_url":"https://avatars.githubusercontent.com/u/733635?v=3","gravatar_id":"","url":"https://api.github.com/users/scrapy","html_url":"https://github.com/scrapy","followers_url":"https://api.github.com/users/scrapy/followers","following_url":"https://api.github.com/users/scrapy/following{/other_user}","gists_url":"https://api.github.com/users/scrapy/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapy/subscriptions","organizations_url":"https://api.github.com/users/scrapy/orgs","repos_url":"https://api.github.com/users/scrapy/repos","events_url":"https://api.github.com/users/scrapy/events{/privacy}","received_events_url":"https://api.github.com/users/scrapy/received_events","type":"Organization","site_admin":false},"repo":{"id":34527721,"name":"parsel","full_name":"scrapy/parsel","owner":{"login":"scrapy","id":733635,"avatar_url":"https://avatars.githubusercontent.com/u/733635?v=3","gravatar_id":"","url":"https://api.github.com/users/scrapy","html_url":"https://github.com/scrapy","followers_url":"https://api.github.com/users/scrapy/followers","following_url":"https://api.github.com/users/scrapy/following{/other_user}","gists_url":"https://api.github.com/users/scrapy/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapy/subscriptions","organizations_url":"https://api.github.com/users/scrapy/orgs","repos_url":"https://api.github.com/users/scrapy/repos","events_url":"https://api.github.com/users/scrapy/events{/privacy}","received_events_url":"https://api.github.com/users/scrapy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scrapy/parsel","description":"Parsel lets you extract data from XML/HTML documents using XPath or CSS selectors","fork":false,"url":"https://api.github.com/repos/scrapy/parsel","forks_url":"https://api.github.com/repos/scrapy/parsel/forks","keys_url":"https://api.github.com/repos/scrapy/parsel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scrapy/parsel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scrapy/parsel/teams","hooks_url":"https://api.github.com/repos/scrapy/parsel/hooks","issue_events_url":"https://api.github.com/repos/scrapy/parsel/issues/events{/number}","events_url":"https://api.github.com/repos/scrapy/parsel/events","assignees_url":"https://api.github.com/repos/scrapy/parsel/assignees{/user}","branches_url":"https://api.github.com/repos/scrapy/parsel/branches{/branch}","tags_url":"https://api.github.com/repos/scrapy/parsel/tags","blobs_url":"https://api.github.com/repos/scrapy/parsel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scrapy/parsel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scrapy/parsel/git/refs{/sha}","trees_url":"https://api.github.com/repos/scrapy/parsel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scrapy/parsel/statuses/{sha}","languages_url":"https://api.github.com/repos/scrapy/parsel/languages","stargazers_url":"https://api.github.com/repos/scrapy/parsel/stargazers","contributors_url":"https://api.github.com/repos/scrapy/parsel/contributors","subscribers_url":"https://api.github.com/repos/scrapy/parsel/subscribers","subscription_url":"https://api.github.com/repos/scrapy/parsel/subscription","commits_url":"https://api.github.com/repos/scrapy/parsel/commits{/sha}","git_commits_url":"https://api.github.com/repos/scrapy/parsel/git/commits{/sha}","comments_url":"https://api.github.com/repos/scrapy/parsel/comments{/number}","issue_comment_url":"https://api.github.com/repos/scrapy/parsel/issues/comments{/number}","contents_url":"https://api.github.com/repos/scrapy/parsel/contents/{+path}","compare_url":"https://api.github.com/repos/scrapy/parsel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scrapy/parsel/merges","archive_url":"https://api.github.com/repos/scrapy/parsel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scrapy/parsel/downloads","issues_url":"https://api.github.com/repos/scrapy/parsel/issues{/number}","pulls_url":"https://api.github.com/repos/scrapy/parsel/pulls{/number}","milestones_url":"https://api.github.com/repos/scrapy/parsel/milestones{/number}","notifications_url":"https://api.github.com/repos/scrapy/parsel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scrapy/parsel/labels{/name}","releases_url":"https://api.github.com/repos/scrapy/parsel/releases{/id}","deployments_url":"https://api.github.com/repos/scrapy/parsel/deployments","created_at":"2015-04-24T15:53:36Z","updated_at":"2016-11-25T12:00:14Z","pushed_at":"2016-11-26T20:43:01Z","git_url":"git://github.com/scrapy/parsel.git","ssh_url":"git@github.com:scrapy/parsel.git","clone_url":"https://github.com/scrapy/parsel.git","svn_url":"https://github.com/scrapy/parsel","homepage":"","size":440,"stargazers_count":120,"watchers_count":120,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":13,"forks":22,"open_issues":13,"watchers":120,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scrapy/parsel/pulls/74"},"html":{"href":"https://github.com/scrapy/parsel/pull/74"},"issue":{"href":"https://api.github.com/repos/scrapy/parsel/issues/74"},"comments":{"href":"https://api.github.com/repos/scrapy/parsel/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/scrapy/parsel/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/scrapy/parsel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scrapy/parsel/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/scrapy/parsel/statuses/5b158731b9d229989bd87ed1be57f6ed4ee4983c"}}}}
{"actor":{"display_login":"stummjr"}}