我正在尝试在Google缓存中进行搜索,因此我需要触发此查询:
http://webcache.googleusercontent.com/search?q=cache:news.ycombinator.com/news+hacker+news
Run Code Online (Sandbox Code Playgroud)
并从页面获取一些内容,如时间戳.但是当我使用curl(ruby)执行此操作时,它会给出一个权限被拒绝的错误,即抓取被阻止并且这是预期的.
那么,有没有办法搜索谷歌缓存(API或某种解决方法)并提取一些信息,如时间戳?
我正在使用Google的自定义搜索API,我向如下所示的网址发出HTTP请求:
https://www.googleapis.com/customsearch/v1?key=<my-key>&cref=&num=10&q=how+can+i+do+htis
如果您在Google上搜索"我该怎么办htis",您会被告知"显示我如何做到这一点的结果",并给您一些结果(称之为结果集A)
但如果您使用API搜索拼写错误的字符串,则会得到与A不同的结果...使用拼写正确的字符串进行搜索会得到结果A,它与Google上的普通搜索服务相匹配
有没有办法直接使用建议的字符串进行搜索?我想使用我自己无法负担实施拼写检查的API,这也可以纠正人名和一切
spell-checking google-search google-search-api search-suggestion
我想在谷歌上获取特定关键字搜索的所有搜索结果.我已经看到了刮痧的建议,但这似乎是一个坏主意.我见过Gems(我计划使用ruby),它会刮掉并使用API.我也看到了使用API的建议.
有谁知道现在最好的方法吗?API不再受支持,我看到有人报告说他们无法获得无法使用的数据.宝石是帮助解决这个问题还是不解决?
提前致谢.
我正在寻找一个在Node.js中使用的Google搜索API包装器,我已经搜索过但没有找到更新和完全烘焙的东西.任何人都可以推荐一些工作吗?谢谢
在我的页面上呈现搜索结果后,我基本上需要运行一些jQuery代码.我可以使用v1代码:
<div id="cse" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'en', style : google.loader.themes.V2_DEFAULT});
google.setOnLoadCallback(function() {
var customSearchOptions = {};
var orderByOptions = {};
orderByOptions['keys'] = [{label: 'Relevance', key: ''},{label: 'Date', key: 'date'}];
customSearchOptions['enableOrderBy'] = true;
customSearchOptions['orderByOptions'] = orderByOptions; var customSearchControl = new google.search.CustomSearchControl(
'zzzzzzzzzzzz', customSearchOptions);
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
var options = new google.search.DrawOptions();
options.setAutoComplete(true);
customSearchControl.setAutoCompletionId('zzzzzz:zzzzzzz+qptype:3');
options.enableSearchResultsOnly();
customSearchControl.draw('cse', options);
function parseParamsFromUrl() {
var params = {};
var parts = window.location.search.substr(1).split('\x26');
for (var i = 0; i < parts.length; …Run Code Online (Sandbox Code Playgroud) 我知道你可以访问http://webcache.googleusercontent.com/search?q=cache:http://example.com/来查看任何网址的Google缓存,但他们是否会提供API以覆盖其中的数千个网址付费访问?
我不想仅仅过快地对这些URL进行HTTP GET,并且禁止使用我的IP地址或让谷歌感到不安.
只是想知道他们是否提供了一种支付方式,并通过官方渠道这样做,就像他们使用他们的搜索API一样.
caching google-api google-search google-search-api web-scraping
嗨,我想将google搜索API添加到我的应用程序中.搜索结果应该显示在列表视图中......任何人都可以给我发送一些示例或者告诉我该怎么做?
我正在尝试将 Google 自定义搜索添加到我的 angular 2 应用程序中。当我将自定义搜索中的代码放入jsfiddle 时,使用自定义搜索中的代码可以工作,但是在将其插入到我的组件中时遇到问题。
问题似乎是,当插入脚本的代码运行时,html 标签<gcse:search>被剥离了它的gcse:一部分<search>,我猜运行的脚本找不到任何可以处理的元素。
My.component.html 本质上是:
<gcse:search></gcse:search>
Run Code Online (Sandbox Code Playgroud)
在 My.component.html.ts 我有一个实现 ngOnInit 的函数
ngOnInit(){
var cx = '016820916711928902111:qw0kgpuhihm';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
}
Run Code Online (Sandbox Code Playgroud) 我在我的python appengine项目中使用了两个ndb和search-api查询.
关于游标的唯一正式文档,我可以找到:
以下事情对我来说不清楚:
我有单页应用程序,我想在其中应用Google自定义搜索.当我搜索某些内容时,我的要求是什么,然后它将显示页面每个部分的结果.我创建了锚标记链接,只要点击它们就会将我重定向到页面的那个部分.
到目前为止我尝试使用来自创建搜索引擎的代码是我的代码:
(function() {
var cx = 'xxxxxxxxxxxxxxxx:xxxxxxxxxx'; //my engine id
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
Run Code Online (Sandbox Code Playgroud)
谢谢您的帮助!
android ×1
angular ×1
caching ×1
cursor ×1
gem ×1
google-api ×1
javascript ×1
jquery ×1
json ×1
node.js ×1
ruby ×1
web-scraping ×1