Forgiven Posted September 16, 2013 Share Posted September 16, 2013 (edited) I don't know, maybe somebody will find this useful in their pentesting arsenal. #!/usr/local/bin/python# HTMLgetter v1.0 by Forgiven# This is a handy bit of python that will reap the HTML code of any page# and output it to a txt file of your choice.import urllib2urlStr = raw_input('Input the full URL of the webpage whose HTML code you which to reap:')fileName = raw_input("Input the *.txt filename for the output:")fileName = fileName + ".txt"fileOut = open(fileName, "w")try: fileHandle = urllib2.urlopen(urlStr) str1 = fileHandle.read() fileHandle.close() print '-'*50 print 'HTML code of URL =', urlStr print '-'*50except IOError: print 'Cannot open URL %s for reading' % urlStr str1 = 'error!'fileOut.writelines(str1)print str1fileOut.close() I thought it was cool, creates a nice txt file of the HTML from a web page...I guess I don't have permission to upload the .py for this above. But the code is small and simple enough to cp. You can find it on github at the link. Edited September 16, 2013 by Forgiven Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.