Skip to content

Commit 56b2d84

Browse files
committed
handle config with xpath null/None
1 parent 30e914a commit 56b2d84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

selectorlib/selectorlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def extract(self, html: str, base_url: str = None):
7373
return fields_data
7474

7575
def _extract_selector(self, field_config, parent_parser):
76-
if 'xpath' in field_config:
76+
if field_config.get("xpath") is None:
7777
elements = parent_parser.xpath(field_config['xpath'])
7878
else:
7979
css = field_config['css']

0 commit comments

Comments
 (0)