Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Google AJAX API from Excel?
Hi!
I'd like to access Google search from Excel to determine page rankings - can anyone point me in the right direction, please? I tried direct HTML access, but Google seems to detect and block this after a few requests, so I'd like to use the AJAX API. Thanks and best regards Martin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Google AJAX API from Excel?
Thsi code gets the number of results for a search at google.
Public Sub GoogleSearch() 'Use and input box for typing in the search words Dim szSearchWords As String Dim szResults As String Dim ie As Object 'InternetExplorer Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True With Sheets("Sheet1") RowCount = 2 Do While .Range("B" & RowCount) < "" szSearchWords = .Range("B" & RowCount).Value 'Get keywords and validate by adding + for spaces between szSearchWords = Replace$(szSearchWords, " ", "+") ie.Navigate "http://www.google.com/search?hl=en&q=" & _ szSearchWords & "&meta=" 'Loop until the page is fully loaded Const READYSTATE_COMPLETE = 4 Do Until ie.ReadyState = READYSTATE_COMPLETE DoEvents Loop Set Results = ie.document.getelementsbytagname("P") For Each itm In Results If InStr(UCase(itm.innertext), "RESULTS") Then MsgBox (itm.innertext) 'really item 3, but arrays staarts at 0 NumberofResults = itm.Children.Item(2).innertext .Range("C" & RowCount) = NumberofResults Exit For End If Next itm RowCount = RowCount + 1 Loop End With 'Explicitly clear memory Set ie = Nothing End Sub "Martin Schneider" wrote: Hi! I'd like to access Google search from Excel to determine page rankings - can anyone point me in the right direction, please? I tried direct HTML access, but Google seems to detect and block this after a few requests, so I'd like to use the AJAX API. Thanks and best regards Martin |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Google AJAX API from Excel?
Joel schrieb:
Thsi code gets the number of results for a search at google. Hi, Joel, thanks for the idea. Unfortunately this triggers the anti-spam-mechanism at Google as well. I'd like to try the official way, do you have code for this as well? Thanks and best regards, Martin |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Google AJAX API from Excel?
I did something similar to this a couple of months ago. I don't know HTML
but I helped somebody use the google tanslation API see posting http://www.microsoft.com/office/comm...xp=&sloc=en-us Joe wrote HTML code to use the translation API and I wrote the code to run the html and put the data in a speadsheet. See if this code causes the anti-spam to trigger. If it doesn't then we can do something similar for your API. "Martin Schneider" wrote: Joel schrieb: Thsi code gets the number of results for a search at google. Hi, Joel, thanks for the idea. Unfortunately this triggers the anti-spam-mechanism at Google as well. I'd like to try the official way, do you have code for this as well? Thanks and best regards, Martin |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Google AJAX API from Excel?
Joel schrieb:
I did something similar to this a couple of months ago. I don't know HTML but I helped somebody use the google tanslation API see posting http://www.microsoft.com/office/comm...xp=&sloc=en-us Hi, Joel, thanks for the link. It pointed me into the right direction. Of course now I have another question (which of course isn't strictly Excel anymore, but I hope I may ask this as well). http://ajax.googleapis.com/ajax/serv...1.0&q=question gives me search results from google.com - is there a way to get results from google.de? I was unable to find a corresponding parameter... Thanks and best regards, Martin |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Google AJAX API from Excel?
I don't know. I will search around the web later but not sure if I will find
anything. "Martin Schneider" wrote: Joel schrieb: I did something similar to this a couple of months ago. I don't know HTML but I helped somebody use the google tanslation API see posting http://www.microsoft.com/office/comm...xp=&sloc=en-us Hi, Joel, thanks for the link. It pointed me into the right direction. Of course now I have another question (which of course isn't strictly Excel anymore, but I hope I may ask this as well). http://ajax.googleapis.com/ajax/serv...1.0&q=question gives me search results from google.com - is there a way to get results from google.de? I was unable to find a corresponding parameter... Thanks and best regards, Martin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
AJAX : Dynamlically pushed JavaScript not working after Update Panel is updated | Excel Programming | |||
Excel on the web similar to google spreadsheets | Excel Discussion (Misc queries) | |||
Google search box on excel | Excel Worksheet Functions | |||
AJAX combo box in excel | Excel Programming | |||
Google search from excel | Excel Programming |