ignore javascript links

ignore anything startswith `javascript:` in href attr
This commit is contained in:
camper42
2018-03-01 20:34:56 +08:00
parent 2aad96cead
commit 64e67d46ff
+1 -1
View File
@@ -212,7 +212,7 @@ class BaseParser:
try:
href = link.attrs['href'].strip()
if href and not (href.startswith('#') and self.skip_anchors and href in ['javascript:;']):
if href and not (href.startswith('#') and self.skip_anchors) and not href.startswith('javascript:'):
yield href
except KeyError:
pass