Skip to content

Commit a0641a7

Browse files
committed
Remove hash links
1 parent d3b40a6 commit a0641a7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

seoanalyzer/page.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,14 @@ def analyze_a_tags(self, bs):
368368

369369
url_filename, url_file_extension = os.path.splitext(modified_url)
370370

371+
# ignore links to images
371372
if url_file_extension in IMAGE_EXTENSIONS:
372373
continue
373374

375+
# remove hash links to all urls
376+
if '#' in modified_url:
377+
modified_url = modified_url[:modified_url.rindex('#')]
378+
374379
self.links.append(modified_url)
375380

376381
def rel_to_abs_url(self, link):

0 commit comments

Comments
 (0)