Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !/usr/bin/env python
- #Get source with scripts run using PyQt4
- import sys
- import signal
- from PyQt4.QtCore import *
- from PyQt4.QtGui import QApplication
- from PyQt4.QtWebKit import QWebPage
- agent = 'Mozilla/5.0 (Windows NT 6.2; x86_64; rv:48.0) Gecko/20100101 Firefox/50.0'
- class Source_W_Scripts(QWebPage):
- def __init__(self, url, file):
- QWebPage.__init__(self)
- self._url = url
- self._file = file
- def userAgentForUrl(self, Qurl):
- return (agent)
- def get_it(self):
- signal.signal(signal.SIGINT, signal.SIG_DFL)
- self.connect(self, SIGNAL('loadFinished(bool)'),
- self.finished_loading)
- self.mainFrame().load(QUrl(self._url))
- def finished_loading( self, result ):
- with open(self._file, 'w') as f:
- f.write(self.mainFrame().toHtml())
- sys.exit(0)
- def main():
- url = input('Enter/Paste url for source: ')
- out_file = input('Enter output file name: ')
- app = QApplication([]) #(sys.argv)
- dloader = Source_W_Scripts(url, out_file)
- dloader.get_it()
- sys.exit(app.exec_())
- if __name__ == '__main__':
- main()
Add Comment
Please, Sign In to add comment