Results 1 to 4 of 4

Thread: How to get Source Code of Webpage?

  1. #1
    Join Date
    Jan 2009
    Posts
    67

    How to get Source Code of Webpage?

    Hi, I am making my own website and it is very difficult to design it in the way, which you want. So, can anyone tell me how to get the source code of web page which will help you to use into your web page? Can anyone have this technique? Give it to me as soon as possible.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to get Source Code of Webpage?

    Hi, you can get the souce code of any website page with the help of just simple click. Confused? Don't know how to do it? It is very simple. Just do the following:

    • Open the page which source code you want.
    • Now click on the view menu of your browser.
    • Now just click on the sorce code.
    • You will get the source code of that particular page. Do changes as per your requirement and then use it.

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    Re: How to get Source Code of Webpage?

    Hi, I don't know how to do this, but got something helpful to you on internet. You just need to use this vb program to get the source code of webpage. Just try it.

    Code:
    Dim URL As String
    Dim Host As String
    Dim Page As String
    Dim lPort As Long
    
    Private Sub GetHTMLSource(ByVal URL As String)
        txtSource = ""
        Host = Mid(URL, InStr(URL, "://") + 3)
        If InStr(Host, "/") > 0 Then
            Page = Mid(Host, InStr(Host, "/"))
            Host = Left(Host, InStr(Host, "/") - 1)
        Else
            Page = "/"
        End If
        If InStr(Host, ":") > 0 Then
            lPort = Mid(Host, InStr(Host, ":") + 1)
            Host = Left(Host, InStr(Host, ":") - 1)
        Else
            lPort = 80
        End If
        With Winsock1
            If .State <> sckClosed Then .Close
            .RemoteHost = Host
            .RemotePort = lPort
            .Connect
        End With
    End Sub
    
    Private Sub cmdGet_Click()
        GetHTMLSource txtURL
    End Sub
    
    Private Sub Timer1_Timer()
        Winsock1.Close
        txtSource = "Connection timeout"
    End Sub
    
    Private Sub Winsock1_Connect()
        Timer1.Enabled = True
        Winsock1.SendData "GET " & Page & " HTTP/1.0" & Chr(10) & Chr(10)
    End Sub
    
    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
        Timer1.Enabled = False
        Dim Buffer As String
        Winsock1.GetData sBuffer
        txtSource = txtSource & Buffer
    End Sub
    
    Private Sub Winsock1_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)
        Winsock1.Close
        txtSource = "Error " & Number & ": " & Description
    End Sub

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    Re: How to get Source Code of Webpage?

    Hi, I am also want to do the same thing as you want to get the source code of webpage, but not able to get anything. I have searched on internet, but not find any trick or material which will help me in this problem. If you able to get any solution about this, just give me also. If I got any solution I will reply on this forum. I had heard about the software, but can't able to find it on internet. If you get that, please give me also.

Similar Threads

  1. What Is a Computer Source Code?
    By McKenzie! in forum Off Topic Chat
    Replies: 10
    Last Post: 02-09-2011, 11:56 PM
  2. Unable to stop webpage from accessing information from other source
    By Tees Mar KH in forum Technology & Internet
    Replies: 3
    Last Post: 14-04-2011, 08:45 AM
  3. source code for Crysis 2
    By Tallulah in forum Video Games
    Replies: 4
    Last Post: 31-03-2011, 10:30 PM
  4. rewrite source code
    By jojobah in forum Software Development
    Replies: 7
    Last Post: 17-10-2008, 02:38 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,645,848.17383 seconds with 17 queries