Merge pull request #11 from Chyroc/fix/links-contain-javascript

fix https://github.com/kennethreitz/requests-html/issues/10 : links contain javascript:;
This commit is contained in:
2018-02-26 07:14:22 -05:00
committed by GitHub
+1 -1
View File
@@ -136,7 +136,7 @@ class HTML:
for link in self.find('a'):
try:
href = link.attrs['href']
if not href.startswith('#') and self.skip_anchors:
if not href.startswith('#') and self.skip_anchors and href not in ['javascript:;']:
yield href
except KeyError:
pass