问题
My intention is to embed Google results in my website. I don't want to customise the domain/s on which the search is performed or anything, just a 'bog standard' Google search based on search parameters I pass it.
2 questions:
- How do I display google results on my website as a response to search criteria entered into a textbox I have?
- Is there any legislation I need to take into account?
I know my second question sounds rather strange but I'm aware that what I'm appearing to do here is present content driven by Google as though it's my own so want to avoid breaching any copyright or 'same-origin policy' type thing.
What I've Tried/Ways I Know I Could Achieve This
- Screen scraping Google's response to a simple web request with the necessary query parameters (but seems a bit excessive)
- Google's custom search (but I don't want to customise anything)
I've tagged this question for some more context.
回答1:
As it is mentioned here
you can use your own XML parser to customize the display for your search users.
with an http request like this:
GET /search?q=bill+material&output=xml&client=test&site=operations
But it has a limitation on number of requests per day, 500 or 1000 I guess.
回答2:
Custom Search can be configured to include the entire Web in its results:
- From the Google Custom Search homepage, click New search engine.
- In the Sites to Search box, enter at least one valid URL (e.g. www.google.com).
- Click Create.
- On the next page, under Optional next steps, click Edit.
- On the Basics tab, under Search Preferences, select Search the entire web but emphasize included sites.
- Click Save Changes.
- In the left-hand menu, under Control Panel, click Sites.
- Delete the site you entered during the initial setup process.
来源:https://stackoverflow.com/questions/21816721/adding-googles-standard-search-not-custom-to-my-website