Viewing Source Problem

Discussion in 'HTML' started by Mel Smith, Oct 16, 2008.

  1. Mel Smith

    Mel Smith Guest

    Dear Friends:
    I'm a fairly new 'newbie' (using IE 7) and getting a bit more
    knowledgable of HTML and have a good thick book on Javascript, and wanting
    to start up a website with Apache 2.2.9 over the next few months

    Situation:

    I visited a favored website yesterday and viewed a big table presented
    on it. I'm very interested in getting the Table data (150 rows, and six
    columns) downloaded to my machine and into a database.

    So, anyway, I then saved the source for the page, and then viewed it
    with my editor , but the data from the table was *not* present in the source
    code -- even though it was dispalyed in my browser window

    Further investigation told me that Javascript was being used to
    re-access the server and show that big table.

    Problem: I *see* the table data on the screen, but *how* can I save what I
    see to a text file ??

    (btw, when I can do this, it is straightforward to parse the text file for
    the needed rows and columns and place them in a database.)

    (another btw, I'm starting to learn a bit about DOM but will probable have
    to learn a lot more_

    TIA,

    --
    Mel Smith
     
    Mel Smith, Oct 16, 2008
    #1
    1. Advertising

  2. Mel Smith

    Irina Rempt Guest

    Mel Smith wrote:

    > Problem: I *see* the table data on the screen, but *how* can I save what
    > I see to a text file ??


    Er, select what's on the screen and paste that in a text editor?

    Irina

    --
    "Of course it is happening inside your head, Harry, but why on earth
    should that mean that it is not real?" --Albus Dumbledore
    http://www.valdyas.org/foundobjects/index.cgi Latest: 11-Oct-2008
     
    Irina Rempt, Oct 16, 2008
    #2
    1. Advertising

  3. Mel Smith

    richard Guest

    On Thu, 16 Oct 2008 10:11:51 -0600, "Mel Smith" <>
    wrote:

    >Dear Friends:
    > I'm a fairly new 'newbie' (using IE 7) and getting a bit more
    >knowledgable of HTML and have a good thick book on Javascript, and wanting
    >to start up a website with Apache 2.2.9 over the next few months
    >
    >Situation:
    >
    > I visited a favored website yesterday and viewed a big table presented
    >on it. I'm very interested in getting the Table data (150 rows, and six
    >columns) downloaded to my machine and into a database.
    >
    > So, anyway, I then saved the source for the page, and then viewed it
    >with my editor , but the data from the table was *not* present in the source
    >code -- even though it was dispalyed in my browser window
    >
    > Further investigation told me that Javascript was being used to
    >re-access the server and show that big table.
    >
    >Problem: I *see* the table data on the screen, but *how* can I save what I
    >see to a text file ??
    >
    >(btw, when I can do this, it is straightforward to parse the text file for
    >the needed rows and columns and place them in a database.)
    >
    >(another btw, I'm starting to learn a bit about DOM but will probable have
    >to learn a lot more_
    >
    >TIA,



    Unless the site page you looked at ended with "html" chances are you
    aren't going to see what you think you should see.
    It's possible the site page was done in PHP which draws the actual
    content from the server, and what you see is the output needed to
    display it.
    Then there are other ways of "hiding" content. Such as with MySQL.

    I have a couple of pages that are totally different to you, then what
    I coded. That's due to the javascript output.

    Saving a page directly from the browser doesn't always give you the
    reults you were looking for. Try saving the page as "Web page
    complete". At least you'll get the other files such as javascript and
    CSS. But maybe not database files.

    On one part of my site, I have pages that uses Iframes. So when you
    save the main page, what you see in the Iframe ain't gonna get
    downloaded to you.

    Html and javascript are but only a small part of the presentation and
    what you see as a "source".
     
    richard, Oct 16, 2008
    #3
  4. Mel Smith

    Mel Smith Guest

    Irina said:
    > Er, select what's on the screen and paste that in a text editor?


    Irina:

    I guess I should have said that I want to do this 'programmatically'.

    That is, using my C-based language (xHarbour -- see www.xharbour.com), I
    am building a program that runs periodically, starts up IE, then does
    something like the following:

    ***************** sample code ***********
    // a few hundred lines of 'setup' above here

    TRY
    oIE := GetActiveObject( "InternetExplorer.Application" )
    CATCH
    TRY
    oIE := CreateObject( "InternetExplorer.Application" )
    CATCH
    Alert( "ERROR ! IExplorer not available. [" + Ole2TxtError()+
    "]" )
    RETURN
    END
    END

    oIE:Visible := .F.
    oIE:Navigate("http://www.somewebsite/somedir/somepage/)

    while oIE:busy
    SecondsSleep(1.00)
    ENDDO

    cHTMLIn := ALLTRIM(oIE:Document:Body:innerHTML)

    MEMOWRIT(cHTMLIn)

    // now go parse the document (cHTMLIN) and pick out and save needed data
    // then leave for a few minutes

    RETURN // in another five minutes or so ...

    **************** end of sample code *****


    So, when the program is finished and tested, I want it to 'regularly'
    start up and run, then get the needed page, 'save' the page, then parse it,
    and place info into an xBase-type database (i.e., relational)

    I will have another CGI program that will 'look' at this database, and
    provide info from that database to my clients.

    btw, the website is a *public* sports-related web with info freely
    available to all who visit.

    -Mel Smith
     
    Mel Smith, Oct 16, 2008
    #4
  5. Mel Smith

    Mel Smith Guest

    Richard said:
    > Unless the site page you looked at ended with "html" chances are you
    > aren't going to see what you think you should see.
    > It's possible the site page was done in PHP which draws the actual
    > content from the server, and what you see is the output needed to
    > display it.
    > Then there are other ways of "hiding" content. Such as with MySQL.
    >
    > I have a couple of pages that are totally different to you, then what
    > I coded. That's due to the javascript output.
    >
    > Saving a page directly from the browser doesn't always give you the
    > reults you were looking for. Try saving the page as "Web page
    > complete". At least you'll get the other files such as javascript and
    > CSS. But maybe not database files.
    >
    > On one part of my site, I have pages that uses Iframes. So when you
    > save the main page, what you see in the Iframe ain't gonna get
    > downloaded to you.
    >
    > Html and javascript are but only a small part of the presentation and
    > what you see as a "source".


    Richard:

    Thanks for the info. I don't know *what* the databases used in the
    website are. I just wish to (programmatically) get a download of what I see
    on the page of my IE window. Persuing the source, it still looks very
    complicated and Javascript and Ajax are used to produce this long table, and
    show it in my browser without the data on the window being in the saved .txt
    file.

    -Mel Smith


    -Mel Smith
     
    Mel Smith, Oct 16, 2008
    #5
  6. Mel Smith

    Bergamot Guest

    Mel Smith wrote:
    >
    > So, anyway, I then saved the source for the page, and then viewed it
    > with my editor , but the data from the table was *not* present in the source
    > code -- even though it was dispalyed in my browser window
    >
    > Further investigation told me that Javascript was being used to
    > re-access the server and show that big table.
    >
    > Problem: I *see* the table data on the screen, but *how* can I save what I
    > see to a text file ??


    You want the generated code. There are extensions for Firefox that let
    you view source code generated by JavaScript, then you should be able to
    save it. Go get the Web Developer extension, if you don't already have it.

    --
    Berg
     
    Bergamot, Oct 16, 2008
    #6
  7. Mel Smith

    richard Guest

    On Thu, 16 Oct 2008 14:12:54 -0600, "Mel Smith" <>
    wrote:

    >Richard said:
    >> Unless the site page you looked at ended with "html" chances are you
    >> aren't going to see what you think you should see.
    >> It's possible the site page was done in PHP which draws the actual
    >> content from the server, and what you see is the output needed to
    >> display it.
    >> Then there are other ways of "hiding" content. Such as with MySQL.
    >>
    >> I have a couple of pages that are totally different to you, then what
    >> I coded. That's due to the javascript output.
    >>
    >> Saving a page directly from the browser doesn't always give you the
    >> reults you were looking for. Try saving the page as "Web page
    >> complete". At least you'll get the other files such as javascript and
    >> CSS. But maybe not database files.
    >>
    >> On one part of my site, I have pages that uses Iframes. So when you
    >> save the main page, what you see in the Iframe ain't gonna get
    >> downloaded to you.
    >>
    >> Html and javascript are but only a small part of the presentation and
    >> what you see as a "source".

    >
    >Richard:
    >
    > Thanks for the info. I don't know *what* the databases used in the
    >website are. I just wish to (programmatically) get a download of what I see
    >on the page of my IE window. Persuing the source, it still looks very
    >complicated and Javascript and Ajax are used to produce this long table, and
    >show it in my browser without the data on the window being in the saved .txt
    >file.
    >
    >-Mel Smith
    >
    >
    >-Mel Smith
    >


    Don't save as a text file. That only gives you what is shown to you.
    Save as a complete web page. Then you'll get more details.
     
    richard, Oct 16, 2008
    #7
  8. Mel Smith

    Mel Smith Guest

    To all you helpful folks:

    Thank you for the guidance and suggestions !


    -Mel Smith
     
    Mel Smith, Oct 17, 2008
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brooke

    Prevent viewing html source

    Brooke, Mar 2, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,211
    Kevin Spencer
    Mar 2, 2006
  2. ÿëѤ  ²°°³

    Viewing source code

    ÿëѤ ²°°³, Sep 12, 2003, in forum: HTML
    Replies:
    3
    Views:
    374
    Adrienne
    Sep 14, 2003
  3. Sathyaish
    Replies:
    1
    Views:
    368
    Richard Bos
    Sep 22, 2004
  4. C. Pielak

    Viewing datagrid's source code

    C. Pielak, Sep 3, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    104
    C. Pielak
    Sep 3, 2003
  5. Julia De Silva

    Viewing HTML source from URL

    Julia De Silva, Dec 12, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    112
    John Bokma
    Dec 12, 2005
Loading...

Share This Page