fyi, the naive url-based search will work with bing, not google these days. google throws a 403 error; it wants a more properly formatted request than the simple string url being passed (some stuff in the headers, ends up being a bit more complicated). I think back when CFBAT was written this wasn’t an issue.
I think this is kind of a substantial exercise, since you are now left with the problem of getting results, and then parsing those results (which are encoded in HTML) into URLs. So you have to understand the format of the search engine’s output to parse the HTML (pedagogically useful but perhaps a bit intense for a beginner exercise). That or use an API to get better formatted results (no idea). There are libraries that make parsing and dissecting and searching the resulting html (or xhtml) really easy though, so it’s not terrible. It seems like the book dangles this out as something trivial (just looking at CH9) when in fact there is “a lot” of stuff left up to the reader.
The simplest way would be to search the HTML for urls using a regular expression. If you sift through the HTML, e.g. with the firefox or chrome inspector, you will get a sense for where the search results are and where the URL is stored. It looks like an href, so something along the lines of scraping the text looking for matches for a regex that conforms to this pattern could work. You could also see if there’s a common regex for URLs (or define your own) and just use that and hope that the only URLs in the search results will be ones the engine presents for clicking.
Look at the section under “Strings” for “Regex” at the cheatsheet for some built-in functions.