Now if we run this, we get the expected results.
So, now we can get raw HTML source code. What next? We could learn how to try to "parse out" the part we want, or I could show you how to POST forms. Let's cover POST first, then the parsing routine will apply to both. The POST example will also be more fun to read results from.
property searchTerms : ""
set searchTerms to text returned of Â
(display dialog "Enter your search terms:" default answer "")
set searchTerms to replaceSimple(searchTerms, space, "+") -- change spaces to pluses
set searchURL to searchBase & searchTerms
-- get the source as a string
set sourceHTML to (do shell script "curl " & quoted form of searchURL & " | vis")
sourceHTML
on replaceSimple(thisText, oldChars, newChars)
-- version 1.1, Daniel A. Shockley http://www.danshockley.com
-- 1.1 coerces the newChars to a STRING, since other data types do not always coerce
-- (example, replacing "nine" with 9 as number replaces with "")
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to the oldChars
set the parsedList to every text item of thisText
set AppleScript's text item delimiters to the {(newChars as string)}
set the newText to the parsedList as string
set AppleScript's text item delimiters to oldDelims
return newText
end replaceSimple