![]() |
| |||||||
| Sponsored Links |
![]() | « Previous Thread | Next Thread » |
| | LinkBack (1) | Thread Tools | Display Modes |
#1
| ||||
| ||||
| I have an excel program that will retrieve data from websites and place it into an excel spreadhseet ... however, it only works with table data. The sites I need to retrieve the data from are using DIV tags and i'm finding it hard to just grab that info. The excel module uses the following: Code: Sub ImportDataWeb()
Sheets("Website Data").Activate
i = 1
Do Until Sheets("Hyperlinks Here").Cells(i, 2) = ""
myquery = Sheets("Hyperlinks Here").Cells(i, 2)
Sheets("Website Data").Cells(1, 1) = myquery
myrow = Sheets("Website Data").UsedRange.Rows.Count + 1
Do
myrow = myrow - 1
Loop Until Sheets("Website Data").Cells(myrow, 1) <> ""
myrow = myrow + 3
With Sheets(3).QueryTables.Add(Connection:= _
"URL;" & myquery, Destination:=Sheets(3).Cells(myrow, 1))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
i = i + 1
Loop
End Sub
Anyone have any ideas?
__________________ Quote of the Month: Regret: It hurts to admit when you make mistakes - but when they're big enough, the pain only lasts a second. Questions to Ponder: Could it be that all those trick-or-treaters wearing sheets aren’t going as ghosts but as mattresses? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright © 2008 sbenj69 |
| Sponsored Links |
|
#2
| ||||
| ||||
| I'm not sure what you're asking can be done very easily. It seems you would have to create a function to actually parse through the HTML and retrieve the information you want. If they had an XML file that was available which contains this data, that would be another story. That would be quite simple.
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.Join our Folding team: DeveloperBarn Folding |
|
#3
| ||||
| ||||
| Does the webpage just contain data or is there lots of other HTML info? Could you give an example of how the page is displayed and/or how the data is formatted? |
|
#4
| ||||
| ||||
| here's a url of an example page i need to get the data from. i would have to gather the name, address, phone & ins co name(s) from this page. this data then needs to go into something like a .CSV file for later import into a SQL Table. click here. this is not the page i need to scrub, just and example of what i'm looking to do. |
|
#6
| ||||
| ||||
| yes ... for example name: Joseph Kaplan address: 617 New York Ave, Absecon, NJ 08201 phone: (609) 645-8543 ins co: High Point etc.... |
|
#7
| ||||
| ||||
| mehere, perhaps this is what you're looking for: Code: Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://www.yahoo.com" 'Place site URL here
IE.Visible = False 'Does not display the browser window
While IE.Busy
DoEvents
Wend
x = IE.document.body.innerHTML
IE.Quit
|
|
#8
| ||||
| ||||
| will look into that ... is this VBA or what? |
|
#10
| ||||
| ||||
| yes it's VBA? or yes it's what? ... |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.developerbarn.com/microsoft-office/68-retrieving-web-data-using-excel.html | ||||
| Posted By | For | Type | Date | |
| DeveloperBarn Forums - ASP Help, ASP.Net Help, PHP Help, SQL Help, Tutorials, Windows Help | This thread | Refback | April 26th, 2008 09:37 AM | |