Incredibly fast crawler designed for OSINT.
Fixed sitemap.xml parsing (Fixes #107)
Somdev Sangwanc1fb0cf92128
diff --git a/photon.py b/photon.pyindex 969e2e2..4470563 100644--- a/photon.py+++ b/photon.py@@ -341,7 +341,7 @@ def xmlParser(response):return findall(r'<loc>(.*?)</loc>', response)-def zap(url):+def zap(inputUrl):"""Extract links from robots.txt and sitemap.xml."""if args.archive:from plugins.wayback import time_machine@@ -356,7 +356,7 @@ def zap(url):verb('Internal page', url)internal.add(url)# Makes request to robots.txt- response = requests.get(url + '/robots.txt', verify=False).text+ response = requests.get(inputUrl + '/robots.txt', verify=False).text# Making sure robots.txt isn't some fancy 404 pageif '<body' not in response:# If you know it, you know it@@ -376,7 +376,7 @@ def zap(url):robots.add(url)print('%s URLs retrieved from robots.txt: %s' % (good, len(robots)))# Makes request to sitemap.xml- response = requests.get(url + '/sitemap.xml', verify=False).text+ response = requests.get(inputUrl + '/sitemap.xml', verify=False).text# Making sure robots.txt isn't some fancy 404 pageif '<body' not in response:matches = xmlParser(response)@@ -384,7 +384,7 @@ def zap(url):print('%s URLs retrieved from sitemap.xml: %s' % (good, len(matches)))for match in matches:- verb('Internal page', url)+ verb('Internal page', match)# Cleaning up the URL and adding it to the internal list for# crawlinginternal.add(match)