使用双引号执行Google Search API查询

时间:2018-10-19 18:58:47

标签: url encoding ascii google-search-api

我想在Google搜索查询中输入以下关键字:“您需要升级Flash Player”管道工

这是我的查询网址:

https://www.googleapis.com/customsearch/v1?key=MYKEY&cx=MYCX&q=“您+需要+升级+您的Flash +播放器” +水暖工

但是当我检索结果时,json会显示以下内容:

"queries": {
  "request": [
   {
    "title": "Google Custom Search - \"you need to upgrade your flash player\" plumbers",
    "totalResults": "0",
    "searchTerms": "\"you need to upgrade your flash player\" plumbers",
    "count": 10,
    "inputEncoding": "utf8",
    "outputEncoding": "utf8",
    "safe": "off",
    "cx": "005343549051574104994:jzi81umtx3o"
   }

如您所见,当在Google搜索中显示约4k个结果时,查询中的引号前会有反斜杠,将其弄乱并使其返回0个结果。

我还尝试过使用转义ASCII,如下所示: https://www.googleapis.com/customsearch/v1?key=MYKEY&cx=MYCX=%22you+need+to+upgrade+your+flash+player%22+plumbers

但是没有任何变化。知道发生了什么事吗?

0 个答案:

没有答案