ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBScript to pull html source code (https://www.excelbanter.com/excel-programming/341850-vbscript-pull-html-source-code.html)

nixter

VBScript to pull html source code
 
I am running a script on a vendor's website and searching for missing images
(whereby the imagename is always a blank jpg named 'imageNA.jpg').

I have the logic to pull the actual site with variables handling the parts
of the URL - I am trying to grab the source code and logically step thru to
see which images are blank (this is for about 900,000 products).

Is there Excel vbscript to pull just the html source code out there?

thanks!!


Tom Ogilvy

VBScript to pull html source code
 
code previously posted by Jake Marx:

Sub Demo()
Dim ie As Object
Dim sWholeFile As String
Dim asLineByLine() As String
Dim lLine As Long


Set ie = CreateObject("InternetExplorer.Application")


ie.Navigate "http://www.longhead.com/"


Do While ie.Busy And Not ie.ReadyState = 4
DoEvents
Loop


sWholeFile = ie.Document.body.innerhtml
ie.Quit
Set ie = Nothing
asLineByLine = Split(sWholeFile, vbCrLf)


For lLine = LBound(asLineByLine) To UBound(asLineByLine)
Sheet1.Cells(lLine + 1, 1).Value = asLineByLine(lLine)
Next lLine
End Sub


--

Regards,

Tom Ogilvy





"Nixter" wrote in message
...
I am running a script on a vendor's website and searching for missing

images
(whereby the imagename is always a blank jpg named 'imageNA.jpg').

I have the logic to pull the actual site with variables handling the parts
of the URL - I am trying to grab the source code and logically step thru

to
see which images are blank (this is for about 900,000 products).

Is there Excel vbscript to pull just the html source code out there?

thanks!!




nixter

VBScript to pull html source code
 
Tom - THANK YOU!!



"Tom Ogilvy" wrote:

code previously posted by Jake Marx:

Sub Demo()
Dim ie As Object
Dim sWholeFile As String
Dim asLineByLine() As String
Dim lLine As Long


Set ie = CreateObject("InternetExplorer.Application")


ie.Navigate "http://www.longhead.com/"


Do While ie.Busy And Not ie.ReadyState = 4
DoEvents
Loop


sWholeFile = ie.Document.body.innerhtml
ie.Quit
Set ie = Nothing
asLineByLine = Split(sWholeFile, vbCrLf)


For lLine = LBound(asLineByLine) To UBound(asLineByLine)
Sheet1.Cells(lLine + 1, 1).Value = asLineByLine(lLine)
Next lLine
End Sub


--

Regards,

Tom Ogilvy





"Nixter" wrote in message
...
I am running a script on a vendor's website and searching for missing

images
(whereby the imagename is always a blank jpg named 'imageNA.jpg').

I have the logic to pull the actual site with variables handling the parts
of the URL - I am trying to grab the source code and logically step thru

to
see which images are blank (this is for about 900,000 products).

Is there Excel vbscript to pull just the html source code out there?

thanks!!






All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com