{"action":"created","issue":{"url":"https://api.github.com/repos/scrapy/parsel/issues/121","repository_url":"https://api.github.com/repos/scrapy/parsel","labels_url":"https://api.github.com/repos/scrapy/parsel/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/scrapy/parsel/issues/121/comments","events_url":"https://api.github.com/repos/scrapy/parsel/issues/121/events","html_url":"https://github.com/scrapy/parsel/pull/121","id":362759470,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MzkwMTQx","number":121,"title":"Fix has-class to deal with newlines in class names","user":{"login":"stummjr","id":1170435,"node_id":"MDQ6VXNlcjExNzA0MzU=","avatar_url":"https://avatars1.githubusercontent.com/u/1170435?v=4","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-21T20:14:57Z","updated_at":"2018-10-09T18:56:21Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/scrapy/parsel/pulls/121","html_url":"https://github.com/scrapy/parsel/pull/121","diff_url":"https://github.com/scrapy/parsel/pull/121.diff","patch_url":"https://github.com/scrapy/parsel/pull/121.patch"},"body":"The `has-class()` XPath function fails to select elements by class when there's a `\\n` character right after the class name we're looking for. For example:\r\n\r\n```python\r\n>>> import parsel\r\n>>> html = '''<p class=\"foo\r\nbar\">Hello</p>\r\n'''\r\n>>> parsel.Selector(text=html).xpath('//p[has-class(\"foo\")]/text()').get() is None\r\nTrue\r\n```\r\n\r\nSuch (broken?) elements are not that uncommon around the web and they break `has-class` expected behavior (at least from my point of view).\r\n\r\nAny thoughts on it?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/scrapy/parsel/issues/comments/428309561","html_url":"https://github.com/scrapy/parsel/pull/121#issuecomment-428309561","issue_url":"https://api.github.com/repos/scrapy/parsel/issues/121","id":428309561,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODMwOTU2MQ==","user":{"login":"stummjr","id":1170435,"node_id":"MDQ6VXNlcjExNzA0MzU=","avatar_url":"https://avatars1.githubusercontent.com/u/1170435?v=4","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},"created_at":"2018-10-09T18:56:21Z","updated_at":"2018-10-09T18:56:21Z","author_association":"MEMBER","body":"@kmike @rennerocha @elacuesta I updated the PR according to the comments. How does it look now?"}}
{"actor":{"display_login":"stummjr"}}