Jack
Member
Hi all
I am trying to pass a search string a user enters to my Google Custom Search Engine (GCSE) https://www.google.com/cse/publicurl?cx=012611895431513734681:xpw195-soo8 . It used to be easy as the search string became part of the URL so I used followhyperlink happily. But these days the GCSE URL stays the same post searching. So effectively the web page is brought up and the text has to go to the right box. Sounds easy right? But I am struggling on this one.
Below is what I have been experimenting with but it falls over at 3rd last line. I don't think I have got the getelementsbyname form names right which I got using Firefox's right click inspect elements
Can anyone shine a light on this topic for me?
Also say you want to have the option of using Firefox not IE?
regards
John
Sub OpenPage()
Dim ie As InternetExplorer
Set ie = New InternetExplorer
ie.Navigate "https://www.google.com/cse/publicurl?cx=012611895431513734681:xpw195-soo8"
While ie.Busy
Wend
ie.Document.getElementsByName("gsc-control-cse").Item.innerText = "help"
ie.Document.getElementsByName("gsc-search-button").Item.Click ie.Visible = True
End Sub
I am trying to pass a search string a user enters to my Google Custom Search Engine (GCSE) https://www.google.com/cse/publicurl?cx=012611895431513734681:xpw195-soo8 . It used to be easy as the search string became part of the URL so I used followhyperlink happily. But these days the GCSE URL stays the same post searching. So effectively the web page is brought up and the text has to go to the right box. Sounds easy right? But I am struggling on this one.
Below is what I have been experimenting with but it falls over at 3rd last line. I don't think I have got the getelementsbyname form names right which I got using Firefox's right click inspect elements
Can anyone shine a light on this topic for me?
Also say you want to have the option of using Firefox not IE?
regards
John
Sub OpenPage()
Dim ie As InternetExplorer
Set ie = New InternetExplorer
ie.Navigate "https://www.google.com/cse/publicurl?cx=012611895431513734681:xpw195-soo8"
While ie.Busy
Wend
ie.Document.getElementsByName("gsc-control-cse").Item.innerText = "help"
ie.Document.getElementsByName("gsc-search-button").Item.Click ie.Visible = True
End Sub