From 609ff8ca19f1c4c168a81121074b91cc0f0d4c47 Mon Sep 17 00:00:00 2001 From: Yen Chi Hsuan Date: Wed, 5 Jul 2017 23:23:35 +0800 Subject: [utils] Support attributes with no values in get_elements_by_attribute() --- test/test_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/test_utils.py') diff --git a/test/test_utils.py b/test/test_utils.py index 2b93b3604..30738e7cf 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1228,6 +1228,12 @@ part 3 self.assertEqual(get_element_by_attribute('class', 'foo', html), None) self.assertEqual(get_element_by_attribute('class', 'no-such-foo', html), None) + html = ''' + + ''' + + self.assertEqual(get_element_by_attribute('itemprop', 'author', html), 'foo') + def test_get_elements_by_class(self): html = ''' nicealso nice -- cgit v1.2.3