简体   繁体   English

如何在没有相同来源政策的情况下将Google搜索结果放入我们的网页

[英]How to get Google results into our webpage without SAME ORIGIN POLICY

We have own form in our webpage. 我们的网页中有自己的表格。 We want to show google( www.google.com/scholar ) results into our webpage. 我们想将google( www.google.com/scholar )结果显示到我们的网页中。 We tried 我们尝试了

  • jQuery, Ajax
  • HTML framing (iFrame, frameset)

    and all of these have SAMEORIGIN issues. 所有这些都有SAMEORIGIN问题。

We also tried using a new tab and found it has same problem here . 我们还使用尝试new tab ,发现它有同样的问题在这里 All these solutions seem to work only with http://www.google.com/custom and no other google websites. 所有这些解决方案似乎只能与http://www.google.com/custom一起使用,而不能与其他google网站一起使用。

Is there any alternative to do so? 还有其他选择吗?

Google prevents you from doing this. Google禁止您这样做。 You could set up some server side code to scrape the results but this would almost definitely be blocked by Google. 您可以设置一些服务器端代码来抓取结果,但这几乎肯定会被Google阻止。 If this suits your needs you can create a form that submits your search to that page and opens it in a new tab like so: 如果适合您的需求,您可以创建一个表单,将搜索提交到该页面,然后在新标签中打开它,如下所示:

<form action="http://scholar.google.co.uk/scholar" method="get" target="_blank">
  <input type="text" name="q">
  <input type="submit" value="Search">
</form>

Live example here: http://jsfiddle.net/v8qG8/ 此处的实时示例: http : //jsfiddle.net/v8qG8/

Update: 更新:

I mentioned that Google would block the scraping of its services, however I just found the third party library which does that. 我提到Google会阻止其服务的报废,但是我刚刚找到了这样做的第三方库。 Not sure on Google's opinion on it though. 不过,不确定Google的意见。 http://www.icir.org/christian/scholar.html http://www.icir.org/christian/scholar.html

I answer it myself. 我自己回答。 There are no solutions so far. 到目前为止,还没有解决方案。

You may also want to look at Google's custom API. 您可能还需要查看Google的自定义API。 You can get 100 free searches a day and then you pay $5 / 1000 search after that. 您每天可以获得100次免费搜索,然后您需要支付$ 5/1000次搜索。 If you cache the results or do low volume this may work for you. 如果您缓存结果或进行少量处理,则可能对您有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Data js客户端如何访问供稿而没有任何同源策略问题? - How can Google Data js-client access feeds without any same-origin-policy issue? 关于Chrome的同源政策的困惑:如何摆脱它而不要求用户禁用Chrome中的安全性? - Confusion about Chrome's same origin policy: how to get rid of it without asking the user disable security in Chrome? Google Maps JavaScript如何绕过“相同原产地政策” - how does google maps javascript bypass the “Same Origin Policy” 谷歌分析如何避免相同的原始政策? - How does google analytics avoid same origin policy? “原产地政策”的安全性如何? - How secure is the “same origin policy”? 这种“ ajax上传器”方法如何绕过相同的原始策略? - How does this method of “ajax uploader” get around the same origin policy? 我怎样才能绕过相同的原产地政策? - How can i get around the same origin policy? Javascript相同来源政策和Google Crome控制台 - Javascript same origin policy and Google crome console 使用Google Maps API时,为什么我没有收到“相同的原始政策”警告? - Why don't I get a 'same origin policy' warning when using the Google Maps API? 如何解决Mozilla中的同源策略 - How to tackle same origin policy in Mozilla
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM