Browse Source
Merge pull request #7 from adieyal/infiniteloop
Fixed #5
pysitemap-python-2.7
Kamo Petrosyan
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
1 deletions
-
pysitemap/crawler.py
|
@ -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 |
|
|