1def redirect(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 remote_url = br.open(self.target).geturl()
12
13 else:
14 remote_url = u.urlopen(self.target).geturl()
15
16 return(remote_url)
17 except Exception as e:
18 print(e)