我正在使用可怕的谷歌搜索宝石搜索谷歌的一些信息。
这是我的红宝石(模型项belongs_to产品):
require 'rubygems'
require "google-search"
query = "Some query for google"
Google::Search::Web.new do |search|
search.query = query
puts search.first.uri
end但我经常得到的结果不一样,在我的浏览器。我想这一切都是关于我的帐户,因为谷歌范围搜索数据根据我的搜索历史和谷歌搜索宝石没有这一历史。
谁知道如何解决这个从google ?得到更多相关结果的问题?
发布于 2017-12-22 19:28:30
由于这个gem现在不受欢迎,我们构建了我们自己的创业板。使用起来非常简单:
query_params = {
q: "query",
google_domain: "Google Domain",
location: "Location Requested",
device: device,
hl: "Google UI Language",
gl: "Google Country",
num: "Number of Results",
}
query = GoogleSearchResults.new query_params
hash_results = query.get_hash
html_results = query.get_html
json_results = query.get_jsonhttps://stackoverflow.com/questions/29565030
复制相似问题