Browse Source

Merge pull request #7 from adieyal/infiniteloop

Fixed #5
pysitemap-python-2.7
Kamo Petrosyan 6 years ago
committed by GitHub
parent
commit
3e272f5c0b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      pysitemap/crawler.py

+ 2
- 1
pysitemap/crawler.py View File

@ -113,9 +113,10 @@ class Crawler:
self.errlog(repr(e)) self.errlog(repr(e))
def is_valid(self, url): def is_valid(self, url):
oldurl = url
if '#' in url: if '#' in url:
url = url[:url.find('#')] url = url[:url.find('#')]
if url in self.visited:
if url in self.visited or oldurl in self.visited:
return False return False
if self.url not in url: if self.url not in url:
return False return False


Loading…
Cancel
Save