Q

Home » Work » Q’s grab the source code from any HTTP based web site!

Q’s grab the source code from any HTTP based web site!

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 45 other followers

Want to grab the source code from ANY web site?

I just created a windows based application which lets you do that, here:

https://sourceforge.net/projects/qsgrabthesourcefromanywebsite/files/

GrabSourceSF

Interested? Download it here.

DLSF

A few screen shots:
(Screen 1: I type in http://www.fbi.gov, and hitting ‘Grab URL)

gs1

(Screen 2: We see ALL the source code for the FBI’s Primary Web page)

GrabSource

(Screen 3: I do the same thing with this project on Sourceforge))GrabSource6

(Screen 4: I copy the data for the FBI’s Web page to the clipboard, to then use and make my own web page or modify it to make it look like my own (below))

GrabSource2

THIS:

FBI3

Gets Turned into this:

fbi4

 

QMostWanted.bmp

The Project

GrabSource4

The Source Code:

Option Explicit

Private Sub cmdCopy_Click()
    On Error Resume Next
    Clipboard.Clear
    Clipboard.SetText txtML.Text
    MsgBox "Copied!", vbOKOnly Or vbInformation, "QZAntics"
End Sub

Private Sub cmdRunit_Click()
    On Error Resume Next
    txtML.Text = ""
    If (wsMain.State <> sckClosed) Then
        wsMain.Close
    End If
    wsMain.Connect txtIP.Text, 80
End Sub

Private Sub Form_Resize()
    On Error Resume Next
    fraSource.Width = Me.Width - 330
    fraSource.Height = Me.Height - 1900
    txtML.Width = fraSource.Width - 200
    txtML.Height = fraSource.Height - 1000
    cmdCopy.Left = fraSource.Width - cmdCopy.Width - 150
    cmdCopy.Top = fraSource.Height - cmdCopy.Height - 150
End Sub


Private Sub wsMain_Connect()
    On Error Resume Next
    Dim sHeader As String
    
    sHeader = "GET /" & txtURL.Text & " HTTP/1.1" & vbCrLf & _
    "Host: " & txtIP.Text & vbCrLf & _
    "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:35.0) Gecko/20100101 Firefox/35.0" & vbCrLf & _
    "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" & vbCrLf & _
    "Accept-Language: en-US,en;q=0.5" & vbCrLf & _
    "Connection: keep-alive" & vbCrLf
        
'    "Accept-Encoding: gzip, deflate" & vbCrLf &
    wsMain.SendData sHeader & vbCrLf
End Sub

Private Sub wsMain_DataArrival(ByVal bytesTotal As Long)
    On Error Resume Next
    Dim sData As String
    sData = Space(bytesTotal)
    wsMain.GetData sData, vbString, bytesTotal
    txtML.Text = txtML.Text & sData
End Sub

Private Sub wsMain_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
    On Error Resume Next
    txtML.Text = Replace(Replace(Format("Error %s1, ""%s2"""), "%s1", Number), "%s2", Description)
End Sub

Enter your email address to follow this blog and receive notifications of new posts by email.