Results 1 to 6 of 6

Thread: Grabbing Text....

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Exclamation

    How do you grab the text off a web page then save it as a text file....!

    I know:

    Code:
    Webbrowser1.Document.documentElement.innerHTML
    gets the HTML....
    I want just the text on the screen.

    also..how do I trigger the Save command in a webbrowser?
    THANKS!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    I didn't have time to test but this should work:

    First Page:

    <html>
    <Head></Head>
    <Body>
    <form Action="myStuff.asp" method="POST">
    Blurbs:
    <input type="text" name="Blurbs"><br>
    <input type="submit" name="Submit" value="Submit!">
    </form>
    </Body>
    </html>


    Second Page: Name it "mystuff.asp"

    <%Response.Buffer=true%>
    <html>
    <Head></Head>
    <Body
    <%Dim filesys, Mystuff
    Set filesys = CreateObject("Scripting,FileSystemObject")
    Set Mystuff = filesys.OpenTextFile("c:\inetpub\wwwroot\HereItIs.txt",8,true)
    Mystuff.WriteLine Request.Form("Blurbs")
    Mystuff.Close%>
    <H2>Go to "c:\inetpub\wwwroot\HereItIs.txt" and see Mystuff!</H2>
    </Body>
    </html>

  3. #3

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Unhappy no...sorry wasnt clear...

    I have my own webbrowser...I need the program to do it....No ASP.
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4
    Guest
    To save the source:

    Code:
    Private Sub Command1_Click()
         Dim strHTML As String
         strHTML = Webbrowser1.Document.documentElement.innerHTML
         Open "C:\Source.txt" For Output As #1
              Print #1, strHTML
         Close #1
    End Sub
    And to trigger the Save dialog box:

    Code:
    WebBrowser1.ExecWB OLECMDID_SAVEAS,OLECMDEXECOPT_PROMPTUSER

  5. #5

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Unhappy not quite.....

    I know how to do that one...I dont need the source.
    I need the actual text on the page. (I dont want to have to pull it out of the source)

    Is there a way to save the page displayed as a text file (not the html)???
    Thanks
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  6. #6

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Talking Good Enough....

    Thanks Matthew Gates...

    To trigger the save as Dialog is good enough....
    (It would be great if I could tell it to save it as a certain name and file type)
    I'll have to settle for Almost full automation....

    So close.....

    Thanks
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width