saving visible text on web page using VBS

Karan Bhangal
Dim url: url = "http://some.url" 'set your page url here'
With WScript.CreateObject("InternetExplorer.Application", "IE_")
.Visible = False
.Navigate url
Do
    WScript.Sleep 100
Loop While .ReadyState < 4 And .Busy
Dim data: data = .Document.Body.innerText
With CreateObject("ADODB.Stream")
    .Open
    .Type     = 2 'adTypeText'
    .Position = 0
    .Charset  = "utf-8"
    .WriteText data
    .SaveToFile "output.txt", 2
    .Close
End With
.Quit
End With

I found this but a proper code will be helpful.

Hackoo

You can try something like that !

You can save this page in both HTML and Text mode ;)

Const TriStateTrue = -1 ' Pour la prise en charge de l'Unicode
URL = InputBox("Entrez l'URL pour y extraire son Code Source HTML "&vbcr&vbcr&_
"Exemple ""http://www.google.fr""","Extraction du Code Source © Hackoo © 2013","http://stackoverflow.com/questions/29597909/saving-visible-text-on-web-page-using-vbs")
If URL = "" Then WScript.Quit
Titre = "Extraction du Code Source de " & URL
Set ie = CreateObject("InternetExplorer.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
ie.Navigate(URL)
ie.Visible=false
DO WHILE ie.busy
LOOP
DataHTML = ie.document.documentElement.innerHTML
DataTxt = ie.document.documentElement.innerText
strFileHTML = "CodeSourceHTML.txt"
strFileTxt = "CodeSourceTxt.txt"
Set objHTMLFile = objFSO.OpenTextFile(strFileHTML,2,True, TriStateTrue)
objHTMLFile.WriteLine(DataHTML)
objHTMLFile.Close
Set objTxtFile = objFSO.OpenTextFile(strFileTxt,2,True, TriStateTrue)
objTxtFile.WriteLine(DataTxt)
objTxtFile.Close
ie.Quit
Set ie=Nothing
 Ouvrir(strFileHTML)
 Ouvrir(strFileTxt)
wscript.Quit
'*************************************************
Function Ouvrir(File)
    Set ws=CreateObject("wscript.shell")
    ws.run "Notepad.exe "& File,1,False
end Function
'*************************************************

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Scrape all visible text from a web page

From Dev

Get visible text of page

From Dev

unwanted <br> tags appearing on web page that are visible using google chrome inspect, but not visible in the app's code

From Dev

Replacing text on web page using HTML or Javascript

From Dev

Replace text in text file using VBS

From Dev

How do I return all visible text on a web page as a big, unparsed string?

From Dev

Web page times out when using Image based persistence and saving with Seaside?

From Dev

wget and curl saving web page as gibberish (encrypted?)

From Dev

post text from files into a web page form using python

From Dev

How to change static text in a web page using inner html?

From Dev

Get text without tags from web page using Jsoup

From Dev

How to get text from a web page using C++?

From Dev

Extract specific text from web-page using python

From Dev

Scraping certain text from a web page using beautiful soup

From Dev

Extract text from dynamic Web page using R

From Dev

How to get XMLHTTPRequest response text of external web page using Java?

From Dev

How to create Multiple bot log-in in one page using VBS

From Dev

Saving Each PDF Page to an Image Using Imagick

From Dev

How to check if IFrame is visible on page using jQuery

From Dev

Copy and replace simple text in a txt file using vbs

From Dev

remove nul characters from text file using vbs

From Dev

Saving data to a text file using arduino and processing

From Dev

changing text on button while saving using Angularjs

From Dev

Saving variable value in a text file using PHP

From Dev

Saving variable value in a text file using PHP

From Dev

No visible text() when using matplotlib.pyplot

From Dev

No visible text() when using matplotlib.pyplot

From Dev

Selenium Web Page in Text Search

From Dev

responsive web design with scaling image with always fully visible page

Related Related

  1. 1

    Scrape all visible text from a web page

  2. 2

    Get visible text of page

  3. 3

    unwanted <br> tags appearing on web page that are visible using google chrome inspect, but not visible in the app's code

  4. 4

    Replacing text on web page using HTML or Javascript

  5. 5

    Replace text in text file using VBS

  6. 6

    How do I return all visible text on a web page as a big, unparsed string?

  7. 7

    Web page times out when using Image based persistence and saving with Seaside?

  8. 8

    wget and curl saving web page as gibberish (encrypted?)

  9. 9

    post text from files into a web page form using python

  10. 10

    How to change static text in a web page using inner html?

  11. 11

    Get text without tags from web page using Jsoup

  12. 12

    How to get text from a web page using C++?

  13. 13

    Extract specific text from web-page using python

  14. 14

    Scraping certain text from a web page using beautiful soup

  15. 15

    Extract text from dynamic Web page using R

  16. 16

    How to get XMLHTTPRequest response text of external web page using Java?

  17. 17

    How to create Multiple bot log-in in one page using VBS

  18. 18

    Saving Each PDF Page to an Image Using Imagick

  19. 19

    How to check if IFrame is visible on page using jQuery

  20. 20

    Copy and replace simple text in a txt file using vbs

  21. 21

    remove nul characters from text file using vbs

  22. 22

    Saving data to a text file using arduino and processing

  23. 23

    changing text on button while saving using Angularjs

  24. 24

    Saving variable value in a text file using PHP

  25. 25

    Saving variable value in a text file using PHP

  26. 26

    No visible text() when using matplotlib.pyplot

  27. 27

    No visible text() when using matplotlib.pyplot

  28. 28

    Selenium Web Page in Text Search

  29. 29

    responsive web design with scaling image with always fully visible page

HotTag

Archive