Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Code to get data from webpage into Excel (v.2)

I read the article "Code to get data from webpage into Excel" while
I was searching to solve my problem.

Actually is quite similar to "donbowyer" 's problem. The code is
:

Sub TheSub()
'Microsoft Internet Controls
'Microsoft HTML Object Library

Dim myIE As InternetExplorer
Dim myDoc As MSHTML.HTMLDocument
Dim myImg As MSHTML.HTMLImg
Dim mySiteUrl As String
Dim E As MSHTML.HTMLGenericElement

MyDay = Format(Now, "YYYYMMDD")

mySiteUrl = "http://tv.pathfinder.gr/" 'URLhp
Set myIE = New InternetExplorer

With myIE
' .Visible = True
.Navigate mySiteUrl
Do Until .readyState = READYSTATE_COMPLETE: Loop
.Document.all.searchDt.Value = mDay
.Document.all.searchChannel.Value = "mega"
.Document.all.searchType.Value "0"
.Document.all.doSearch.Click
Do Until .readyState = READYSTATE_COMPLETE: Loop

Set myDoc = .Document

With myDoc
ActiveSheet.Cells(1, "A").Value = .body.innerText
End With

End With

myIE.Quit
Set myIE = Nothing
Set myDoc = Nothing
End Sub

The purpose is to go to the startpage : http://tv.pathfinder.gr/" ,
put 3 criteria programmatically (mDay, "mega", "0"), do the
Search (doSearch.Click) and after the page has loaded with the results
to get the results (the table with the TV program) in the active sheet.
The problem is that I get data from the first page not from the page
with the results (second page). Any suggestions would be most welcome.

Charalampos

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing webpage data into Excel Dave Excel Discussion (Misc queries) 4 May 21st 07 09:04 PM
Code to get data from webpage into Excel donbowyer Excel Programming 5 January 1st 06 03:25 AM
In Excel 2000 can you write VBA code to pull data from a webpage? kurt Excel Programming 2 September 24th 04 05:59 AM
In Excel 2000 can you write VBA code to pull data from a webpage? kurt Excel Programming 1 September 24th 04 01:26 AM
Open Webpage and then Run Code Nick Excel Programming 0 November 18th 03 10:31 PM


All times are GMT +1. The time now is 03:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"