Hello,
Posted this on another forum, but no luck there, nobody is answering the thread.
http://www.mrexcel.com/forum/excel-q...-web-page.html
Basically, I'm trying to make macro that would copy data from one cell, open web page, put that data in search box on web page and after the page loads with search results click on arrow wrapper to open specific contest. So far, all things work well except that last step, I'm unable to press that arrow on a web page and open/unhide specific content after I click search.
This is what I have so far:
Sub Login()
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
Dim ImeRadnje As String
ImeRadnje = Range("A3").Value
' Create InternetExplorer Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False
' Send the form data To URL As POST binary request
IE.Navigate "http://www.marksandspencer.com/MSStoreFinderGlobalBaseView?storeId=10151&langId=-24&catalogId=10051"
' Statusbar
Application.StatusBar = "Store Locator is loading. Please wait..."
' Wait while IE loading...
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
'Status bar info
Application.StatusBar = "Typing store name. Please wait..."
' Find input tag:
Set objCollection = IE.document.getElementsByTagName("input")
i = 0
While i < objCollection.Length
If objCollection(i).Name = "searchCriteria" Then
' Set text for search
objCollection(i).Value = ImeRadnje
Else
If objCollection(i).Type = "submit" And _
objCollection(i).Name = "find" Then
' "Search" button is found
Set objElement = objCollection(i)
End If
End If
i = i + 1
Wend
'click button to search
objElement.Click
' Wait while IE re-loading...
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
'Click on arrow wrapper????!!
' Show IE and maximize
IE.Visible = True
apiShowWindow IE.hwnd, SW_MAXIMIZE
' Clean up
Set IE = Nothing
Set objElement = Nothing
Set objCollection = Nothing
Application.StatusBar = ""
End Sub
Web page is http://www.marksandspencer.com/MSSto...atalogId=10051
What I'm trying to open is tab called "Opening Hours", div class = "arrow-wrapper".
You can type e.g. "Marble Arch" in lower search box (and then search) of web site I posted and you will get a clue what i'm searching for.
Any help would be appreciated.
Thanks!
Bookmarks