提交 9bc624d3 编写于 作者: H hjdhnx

js0语法优化,支持元素排除

上级 a9d6317a
......@@ -15,6 +15,7 @@ PARSE_CACHE = True # 解析缓存
NOADD_INDEX = ':eq|:lt|:gt|:first|:last|^body$|^#' # 不自动加eq下标索引
URLJOIN_ATTR = '(url|src|href|-original|-src|-play|-url)$' # 需要自动urljoin的属性
class jsoup:
def __init__(self, MY_URL=''):
self.MY_URL = MY_URL
......@@ -62,7 +63,7 @@ class jsoup:
return parse
def getParseInfo(self,nparse):
def getParseInfo(self, nparse):
"""
根据传入的单规则获取 parse规则,索引位置,排除列表 -- 可以用于剔除元素,支持多个,按标签剔除,按id剔除等操作
:param nparse:
......@@ -88,7 +89,7 @@ class jsoup:
nparse_index = 0
if nparse_index > 0:
print(f'nparse_rule:{nparse_rule},nparse_index:{nparse_index},excludes:{excludes}')
return nparse_rule,nparse_index,excludes
return nparse_rule, nparse_index, excludes
else:
if self.test('--', nparse):
nparse_rule = nparse.split('--')[0]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册