WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Web Scraping

 Keywords: Web Scrape Scraping Webscrape 

WinBatch includes the WinInet Internet Extender. The WinInet Internet Extender contains a slew of functions which allow communication between host computers, Internet Service Providers and supported networks for Windows operating systems. The iReadData function allows you to read the contents of a webpage to a file on disk.
; Normal Direct Connect
AddExtender("WWINT44I.DLL")
tophandle=iBegin(0,"","")
datahandle=IUrlOpen(tophandle,"http://www.windowware.com")
xx=iReadData(datahandle,"c:\temp\abc.txt")
iClose(datahandle)
iClose(tophandle)
Message("All","Done")
Exit
For more about WinInet and WebServers see the following technical Support database article: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+Tutorials+HTTP~and~WinInet~-~An~Opus.txt


Alternatively the Microsoft Internet Explorer has a COM interface that lets you control it programmatically. This interface will also let you access the objects on the web pages a major point when you need not only to retrieve information but actually need to interact with the web pages forms.

;   Retrieve the HTML of a web page?

editor = "notepad.exe"
tPath  = DirScript()
url    = "http://www.google.com"
hfile  = StrCat(tPath, "Q1.html")

:MSIE
   msie = ObjectCreate("InternetExplorer.Application")
   msie.addressbar = @FALSE
   msie.statusbar = @FALSE
   msie.menubar = @FALSE
   msie.toolbar = @FALSE
   msie.visible = @TRUE
   msie.navigate(url)
   While msie.busy || msie.readystate <> 4
      TimeDelay(0.5)
   EndWhile
   FilePut(hfile, msie.document.GetElementsByTagName("HTML").item(0).outerHTML)
   msie.quit
   msie = 0
   Message("All","Done")
   Run(editor, hfile)
Return
For more about MSIE’s COM Interface and WInBatch see the following technical Support database article: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+Tutorials+Working~With~Web~Pages.txt
Article ID:   W17424
File Created: 2014:07:18:09:51:38
Last Updated: 2014:07:18:09:51:38