1def HTTPcode(self):
2 try:
3 if self.agent == True:
4 br = Browser()
5
6 UserAgent = "Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0"
7 header = {"User-Agent" : UserAgent}
8 br.set_handle_robots(False)
9 br.addheaders = [("User-agent", "Fifefox")]
10
11 resp = br.open(self.target).code
12
13 else:
14 resp = u.urlopen(self.target).getcode()
15
16 return(resp)
17 except (u.HTTPError, u.URLError):
18 return(404)