''' Returns a User Agent that will be seen by the website. ''' return "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36" if __name__ == "__main__": def timer_func(): global app, nam #print("Done") print("REDIECTS: {}".format(pprint.pformat(nam.redirects))) app.exit(0) url = sys.argv[1] app = QApplication(sys.argv) wv = QWebView() wv.app = app wp = RedirectLoggerWebPage(wv) wv.setPage(wp) timer = QTimer() timer.timeout.connect(timer_func) timer.start(60 * 1000) wv.load(QUrl(url)) app.exec_() #print("Exiting")