mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-21 16:30:28 +00:00
robotparser2
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@217 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
3254f921ee
commit
29921eb3ef
1 changed files with 2 additions and 3 deletions
|
|
@ -50,13 +50,12 @@ class RobotFileParser:
|
|||
import httplib
|
||||
tries = 0
|
||||
while tries<5:
|
||||
_debug(self.host)
|
||||
_debug(self.path)
|
||||
_debug(self.host+self.path)
|
||||
connection = httplib.HTTP(self.host)
|
||||
connection.putrequest("GET", self.path)
|
||||
connection.endheaders()
|
||||
status, text, mime = connection.getreply()
|
||||
if status in [301,302]:
|
||||
if status in [301,302] and mime:
|
||||
tries = tries + 1
|
||||
newurl = mime.get("Location", mime.get("Uri", ""))
|
||||
newurl = urlparse.urljoin(self.url, newurl)
|
||||
|
|
|
|||
Loading…
Reference in a new issue