HTML source dl

  • 16 years ago

    i am using the code that follows, it works on all most sites


    Code:
    Private Function GetSourceCode(strUrl As String) As String
       Dim strData As String
       Dim objInet As Object
       Dim intRetry As Integer
       intRetry = 0
       ' Creating an instance of the Internet Transefer Control Object
       Set objInet = CreateObject("InetCtls.Inet")
       ' Set the timeOut property to 20 seconds
       objInet.RequestTimeout = 20
       ' Create a retry loop for the image loop
       On Error Resume Next
       While Len(strData) = 0 And intRetry < 3
           ' Download source code from the url
           strData = objInet.OpenURL(strUrl)
           intRetry = intRetry + 1
       Wend
       ' Set the created instance to nothing
       Set objInet = Nothing
       ' Return the value
       GetSourceCode = strData
    End Function


    A site it doesn't work on is http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=1


    Thank you for your help

  • 16 years ago

    HI, is this the html u would expect to return??


    Code:

    <HTML>
    <HEAD>
    <LINK REL="stylesheet" TYPE="text/css" HREF="/style.css">
    <LINK REL="shortcut icon" HREF="http://www.ticalc.org/favicon.ico">
    <SCRIPT LANGUAGE="JavaScript" SRC="/mfunctions.js"></SCRIPT>


    <TITLE>View Account - ticalc.org</TITLE>
    </HEAD>
    <BODY BGCOLOR="white" MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0" TEXT="black" LINK="#0066CC" VLINK="#666699">
    <FONT FACE="Verdana,Arial,Helvetica">


    <!-- header -->


    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><!-- logo -->
    <TR BGCOLOR="white">
    <TD><A HREF="/"><IMG SRC="/images/logo.jpg" WIDTH="500" HEIGHT="90" BORDER="0" ALT="ticalc.org"></A></TD>
    </TR>
    <TR BGCOLOR="black"><!-- black line -->
    <TD><IMG SRC="/images/clearpixel.gif" WIDTH="1" HEIGHT="2" ALT=""></TD>
    </TR>
    </TABLE>


    <!-- links -->


    <TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR BGCOLOR="#FFEECC">


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/basics/"><FONT SIZE="2">Basics</FONT></A>
    </TH>


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/archives/"><FONT SIZE="2">Archives</FONT></A>
    </TH>


    <TH BGCOLOR="#0066CC" WIDTH="20%">
    <A CLASS="TopVLink" HREF="/community/"><FONT COLOR="white" SIZE="2">Community</FONT></A>
    </TH>


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/services/"><FONT SIZE="2">Services</FONT></A>
    </TH>


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/programming/"><FONT SIZE="2">Programming</FONT></A>
    </TH>


    </TR>
    <TR BGCOLOR="#FFEECC">


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/hardware/"><FONT SIZE="2">Hardware</FONT></A>
    </TH>


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/help/"><FONT SIZE="2">Help</FONT></A>
    </TH>


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/about/"><FONT SIZE="2">About</FONT></A>
    </TH>


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/search/"><FONT SIZE="2">Search</FONT></A>
    </TH>


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/account/"><FONT SIZE="2">Your Account</FONT></A>
    </TH>


    </TR>
    </TABLE>


    <!-- /links -->


    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><!-- black line -->
    <TR BGCOLOR="black">
    <TD><IMG SRC="/images/clearpixel.gif" WIDTH="1" HEIGHT="2" ALT=""></TD>
    </TR>
    </TABLE><!-- /black line -->


    <TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR BGCOLOR="white">
    <TH>
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="1">
      
    <A HREF="/">Home</A>
    <FONT COLOR="#666666"><I>::</I></FONT>
    <A HREF="/community/">Community</A>
    <FONT COLOR="#666666"><I>::</I></FONT>
    <A HREF="/community/directory/">Accounts Directory</A>
    <FONT COLOR="#666666"><I>::</I></FONT>
    View Account


    </FONT>
    </TH>
    </TR>
    </TABLE>


    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><!-- black line -->
    <TR BGCOLOR="black">
    <TD><IMG SRC="/images/clearpixel.gif" WIDTH="1" HEIGHT="2" ALT=""></TD>
    </TR>
    </TABLE><!-- /black line -->


    <TABLE WIDTH="100%" BORDER="0" CELLPADDING="15" CELLSPACING="0"><!-- body -->
    <TR BGCOLOR="#DDDDDD">
    <TD class=t1 WIDTH="100%" VALIGN="TOP">
    <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0" WIDTH="100%">
    <TR BGCOLOR="#003399">
    <TH>
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica">
    View Account
    </FONT>
    </TH>
    </TR>
    <TR BGCOLOR="#003399" VALIGN="TOP">
    <TD>
    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="5" WIDTH="100%">
    <TR BGCOLOR="white">
    <TD>
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    <CENTER>


    <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0" WIDTH="500">
    <TR BGCOLOR="#003399">
    <TH>
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica">
    User Information
    </FONT>
    </TH>
    </TR>
    <TR BGCOLOR="#003399">
    <TD>
    <TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    Handle (Username)
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#DDDDDD" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    aselle
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    Name
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#EEEEEE" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    Andy Selle
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    Email
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#DDDDDD" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B><A HREF="mailto:aselle@ticalc.org">aselle@ticalc.org</A></B>
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    URL
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#EEEEEE" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B><A TARGET="_blank" HREF="http://www.upl.cs.wisc.edu/~aselle/">http://www.upl.cs.wisc.edu/~aselle/</A></B>
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    Country
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#DDDDDD" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    United States
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    Primary Platform
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#EEEEEE" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    Windows XP
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    Time Zone
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#DDDDDD" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    GMT -06:00 Central (U.S. & Canada)
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    File Author
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#EEEEEE" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B><A HREF="/archives/files/authors/11/1187.html">View Author Profile</A></B>
    </FONT>
    </TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    </TABLE>


    <P></P>
    <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0" WIDTH="500">
    <TR BGCOLOR="#003399">
    <TH>
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica">
    Calculator Info
    </FONT>
    </TH>
    </TR>
    <TR BGCOLOR="#003399">
    <TD>
    <TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    Calculator(s) Owned
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#EEEEEE" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    TI-82, TI-85, TI-92
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    Link Cable(s) Owned
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#DDDDDD" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    Parallel Link ($5 Link)
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    Programs For
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#EEEEEE" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    TI-82 BASIC, TI-82 Assembly, TI-85 BASIC, TI-85 Assembly, TI-92 BASIC, TI-92 Assembly
    </FONT>
    </TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    </TABLE>


    <P></P>


    <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0" WIDTH="500">
    <TR BGCOLOR="#003399">
    <TH>
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica">
    Alternative Contacts
    </FONT>
    </TH>
    </TR>
    <TR BGCOLOR="#003399">
    <TD>
    <TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    AIM
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#DDDDDD" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    aselledb8
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    ICQ
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#EEEEEE" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    3490235
    </FONT>
    </TD>
    </TR>
    <TR>
    <TD ALIGN="RIGHT" BGCOLOR="#0066CC" VALIGN="TOP">
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica" SIZE="2">
    <B>
    Yahoo! Pager
    </B>
    </FONT>
    </TD>
    <TD BGCOLOR="#DDDDDD" VALIGN="TOP">
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    aselle
    </FONT>
    </TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    </TABLE>


    <P></P>


    <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0" WIDTH="500">
    <TR BGCOLOR="#003399">
    <TH>
    <FONT COLOR="white" FACE="Verdana,Arial,Helvetica">
    Bio
    </FONT>
    </TH>
    </TR>
    <TR BGCOLOR="#003399" VALIGN="TOP">
    <TD>
    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="5" WIDTH="100%">
    <TR BGCOLOR="white">
    <TD>
    <FONT FACE="Verdana,Arial,Helvetica" SIZE="2">
    <P>
    Hi I'm me.
    </P>
    </FONT>
    </TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    </TABLE>
    </CENTER>
    </FONT>
    </TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    </TABLE><!-- /body -->


    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><!-- black line -->
    <TR BGCOLOR="black">
    <TD><IMG SRC="/images/clearpixel.gif" WIDTH="1" HEIGHT="2" ALT=""></TD>
    </TR>
    </TABLE><!-- /black line -->


    <!-- copyright notice -->


    <FONT FACE="Verdana,Arial,Helvetica" SIZE="1">
    <P>
      Copyright © 1996-2003, the ticalc.org project.  All rights reserved. |
    <B><A HREF="/about/contact.html">Contact Us</A></B> |
    <B><A HREF="/about/disclaimer.html">Disclaimer</A></B>
    </P>
    </FONT>


    <!-- /copyright notice -->


    </FONT>
    </BODY>
    </HTML>




    i just tried my html extraction in webedit (compiled version), so if this is the returned html code u expect, ill give u my code.

  • 16 years ago

    This code worked in every site i tried it...


    Code:

    <html>
    <HEAD>


    <SCRIPT LANGUAGE="JavaScript">


    <!-- Begin
    function viewSource() {
    document.getSource.view.value="Please wait!";
    setTimeout("document.getSource.view.value='View Source!'",6000);
    window.location.href= "view-source:" + document.getSource.url.value;
    return false;
    }
    //  End -->
    </script>
    </HEAD>


    <BODY>
    <body bgcolor="#09C709">


    <center>
    Type in a full URL and click "View Source"
    <br>
    <br>
    <form name=getSource onSubmit="return viewSource();">
    <input type=text name=url value="http://">
    <br>
    <br>
    <input type=submit name=view value="View Source">
    </form>
    </center>


    </html>



    You can try it if you wish...


  • 16 years ago

    hey rollershade, yeah -- could you please post that?


    I'm curious to see what it would look like...!
    also -- would your code work on different boxes? (i.e., win95/98/NT/2000/XP/ME)
    (geez! just realized -- over the last 5 years, there's been like 5 new versions
    of windows! b4 it was just like PC-DOS, MS-DOS 2.0, 3.0, 3.1, 4.0, 5.0, 6.0,
    but pretty much all the same OS! anyyyyyyyyyyyways...)


    just wondering about your control -- does it use the winsock thing?
    (I forget what it is called, haven't really looked into it)... what would
    you do if you actually wanted to 'program' it yourself (i.e., the internet
    access, i guess 'sockets') -- without using a 3rd party control???

  • 16 years ago

    yes rollershade that is the html i would expect, but the one i have is only giving me.


    Code:
    <HTML>
    <HEAD>
    <LINK REL="stylesheet" TYPE="text/css" HREF="/style.css">
    <LINK REL="shortcut icon" HREF="http://www.ticalc.org/favicon.ico">
    <SCRIPT LANGUAGE="JavaScript" SRC="/mfunctions.js"></SCRIPT>
    <TITLE>View Account - ticalc.org</TITLE>
    </HEAD>
    <BODY BGCOLOR="white" MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0" TEXT="black" LINK="#0066CC" VLINK="#666699">
    <FONT FACE="Verdana,Arial,Helvetica">


    <!-- header -->


    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><!-- logo -->
    <TR BGCOLOR="white">
    <TD><A HREF="/"><IMG SRC="/images/logo.jpg" WIDTH="500" HEIGHT="90" BORDER="0" ALT="ticalc.org"></A></TD>
    </TR>
    <TR BGCOLOR="black"><!-- black line -->
    <TD><IMG SRC="/images/clearpixel.gif" WIDTH="1" HEIGHT="2" ALT=""></TD>
    </TR>
    </TABLE>
    <!-- links -->
    <TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR BGCOLOR="#FFEECC">


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/basics/"><FONT SIZE="2">Basics</FONT></A>
    </TH>


    <TH WIDTH="20%" onMouseOver="mOvr(this);" onMouseOut="mOut(this);" onClick="mClk(this);">
    <A CLASS="TopLink" HREF="/archives/"><FONT SIZE="2">Archives</FONT></A>
    </TH>


    <TH BGCOLOR="#0066CC" WIDTH="20%">
    <A CLASS="To



    if you could send me or paste here the code it would be excellext


    Thank you for your time


    sorry amoibade but in this context i need it to be a vb one for the project, Thanks anyway

  • 16 years ago

    sorry i don't mean to be pushy but i thought that you may have actidentally deleted the notificaton or something


    i just wanted to remind you.


    Hope to hear from you soon

  • 16 years ago

    hi, sos i have been down the pub, put the inet control on the formand add the code as follows:


    Code:

    On Error GoTo errernext
    ' Download file routine
    Label3.Caption = "Downloading..."
    Me.MousePointer = 11


      Dim s As String
      Me.MousePointer = 0
       s = Inet1.OpenURL(Text1.text)


       Open "C:\TemporaryFile.html" For Binary As #1
       Put #1, , s
       Close #1
    Label3.Caption = "DownLoad Complete!"
    '''create mdi page ''''''''
    Static lDocumentCount As Long
       Dim frmD As frmDocument
       lDocumentCount = lDocumentCount + 1
       Set frmD = New frmDocument
       frmD.Caption = Text1.text
       frmD.Show
    frmD.CodeMax1.OpenFile "C:\TemporaryFile.html"
    Label3.Caption = "Inactive"
    Kill "C:\TemporaryFile.html"
    Me.Hide
    Exit Sub
    errernext:
    MsgBox "There was an error while accessing the Source Code, it may be that username and password is required.", vbCritical, ":: External Error ::"
    Me.MousePointer = vbDefault



    delete the unneccesaruy good for mdi create. Text1.text is the web location

  • 16 years ago

    or alternatively, if your not into Inet.. get into Winsocks...


    http://www.vbip.com/winsock/winsockhttp03_01.asp
    http://www.vbip.com/winsock/index.asp

  • 16 years ago

    hey


    rollershade i tried that and it did the same as the one i had, it must be my inet control is stuffed or some buffer thing is set wrong


    wsoftware i am now using the wsck control, i didn't know that you could use a proxy with the winsock control, i think it might be only for http.


    thanks again

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is anticipated with distaste, performed with reluctance, and bragged about forever.” - Dan Kaminsky