I'm trying to grab a URL from a normal Google search, but I just can't think of how and what functions to use. Let's say I just want to search google for: "classical music" Bach. The search could be anything. How would I go about getting this google URL with this search? Perhaps there's a way to make this search behind the scenes where the search doesn't come up?

My main goal is to then get the URL, and open the file using the file() function.

Thanks for the help!