首页 > 解决方案 > Why does an HTTP request to google images return the image as gstatic

问题描述

I'm trying to send an HTTP request to

https://www.google.com/search?q=cats&tbm=isch&ie=UTF-8&safe=active

to get the image URL of the first image.

However, I receive URL like:

https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR1M6cnFrSeLZ4Mhu6G7M4_1hxuM1Svg-QJ2dnBYv5kM1Kg5GDzx91AZccX-Q&s 

instead of the URL that I find when I search it manually (https://icatcare.org/app/uploads/2018/07/Thinking-of-getting-a-cat.png).

Any ideas? The problem is that in the HTML the URL is different.

标签: httprequest

解决方案


我相信 gstatic 是谷歌提供静态内容的域。

我敢打赌,谷歌搜索结果页面的 DOM 中的图像实际上是从他们自己的静态内容域 (gstatic) 提供的,而不是托管原始图像的实际网站 (icatcare.org)。


推荐阅读