def _build_wd_selector(self, selectors):
if any(isinstance(val, re._pattern_type) for val in selectors.values()):
return None
selectors.pop('tag_name', None)
input_attr_exp = self.xpath_builder.attribute_expression('input', selectors)
xpath = './/input[(not(@type) or ({}))'.format(self._negative_type_expr)
if input_attr_exp:
xpath += ' and {}'.format(input_attr_exp)
xpath += ']'
logging.debug({'build_wd_selector': xpath})
return ['xpath', xpath]
评论列表
文章目录