[英]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.