diff --git a/urlscan.py b/urlscan.py index 28ed5e3..d8f89d5 100644 --- a/urlscan.py +++ b/urlscan.py @@ -55,5 +55,23 @@ def getScreenshot(self): else: raise Exception('Non-200 respond: %s - %s' % screen.status_code,screen.text) + # def getReport(self): + # self.checkStatus() + # header = {'API-Key':self.apikey} + # result = requests.get("https://urlscan.io/result/%s/" % self.scanid,headers=header) + # if result.status_code == 200: + # return result.text + # else: + # raise Exception('Non-200 respond: %s - %s' % result.status_code,result.text) + + def getJson(self): + self.checkStatus() + header = {'API-Key':self.apikey} + json = requests.get("https://urlscan.io/api/v1/result/%s/" % self.scanid,headers=header) + if json.status_code == 200: + return json.json() + else: + raise Exception('Non-200 respond: %s - %s' % json.status_code,json.text) + def __repr__(self): - return "" % (self.url,self.useragent,self.referer,self.public,self.scanid) \ No newline at end of file + return "" % (self.url,self.useragent,self.referer,self.public,self.scanid)