Patch for --forms/--crawl (if no protocol specified)

This commit is contained in:
Miroslav Stampar
2019-10-31 20:40:37 +01:00
parent 5c5719b81a
commit 7a6e2df997
2 changed files with 10 additions and 2 deletions

View File

@@ -347,6 +347,10 @@ def _setCrawler():
for i in xrange(len(targets)):
try:
target = targets[i]
if not re.search(r"\Ahttp[s]*://", target):
target = "http://%s" % target
crawl(target)
if conf.verbose in (1, 2):
@@ -484,7 +488,11 @@ def _findPageForms():
for i in xrange(len(targets)):
try:
target = targets[i]
target = targets[i].strip()
if not re.search(r"\Ahttp[s]*://", target):
target = "http://%s" % target
page, _, _ = Request.getPage(url=target.strip(), cookie=conf.cookie, crawling=True, raise404=False)
if findPageForms(page, target, False, True):
found = True