Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Okay, I'm needing to do this same thing again, but can't figure out where the
item/innertext I need is: The webpage is: http://www.gocomics.com/calvinandhobbes/2010/01/16 ....and what I need is the image (on this particular page it's): http://imgsrv.gocomics.com/dim/?fh=8...8010a8&w=900.0 thanks, SouthernAtHeart "Joel" wrote: You don't need to get the source. You can use the IE explorer like below to help you filter the data. The source is under the IE.Document.all property. You can get these lines by doing a loop like this for each itm in IE.Document 'your code here next itm You can use the methods getElementsByTagname(), and getElementById() to help you filter the data. I often for debuggin use something like this RowCount = 1 for each itm in IE.Document Range("A" & RowCount) = itm.tagname Range("B" & RowCount) = itm.Classname Range("C" & RowCount) = itm.id Range("D" & RowCount) = left(itm.innertext,1024) RowCount = rowcount + 1 next itm The source is partioned into items. Has you go down the ALL property the innertext is partioned into small pices. When you do the dump above you will see the same innertext repeated over and over again but broken into samller pieces each time it is repeated. If you need more help give me the URL and I will get what you need. I help lots of people who have had problems. Sub GetZipCodes() ZIPCODE = InputBox("Enter 5 digit zipcode : ") Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True URL = "http://zip4.usps.com/zip4/citytown_zip.jsp" 'get web page IE.Navigate2 URL Do While IE.readyState < 4 And _ IE.busy = True DoEvents Loop Set Form = IE.document.getElementsByTagname("Form") Set zip5 = IE.document.getElementById("zip5") zip5.Value = ZIPCODE Set ZipCodebutton = Form(0).onsubmit Form(0).submit Do While IE.busy = True DoEvents Loop Set Table = IE.document.getElementsByTagname("Table") Location = Table(0).Rows(2).innertext IE.Quit MsgBox ("Zip code = " & ZIPCODE & " City/State = " & Location) End Sub "Southern at Heart" wrote: I need to get the source code of a web page and asign it to a string, where I can search out the specific data I'm needing from the page. (a web query of the page gives me most of the data I need, but it doesn't give me the google map on that page, and the gps coordinates which I need in my sheet) If I open the page in IE, view the source, I can programmatically filter out the coordinates. So, my question: How to get the source saved to a string in vba thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
creating drop down lists from source on another page | Excel Worksheet Functions | |||
Get address from iFrame reference in page source | Excel Programming | |||
Importing Web Page Source Code | Excel Programming | |||
Viewing source code when saved as web page | Excel Discussion (Misc queries) | |||
Get source from a web page into a worksheet | Excel Programming |