httprequest - 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.
解决方案
我相信 gstatic 是谷歌提供静态内容的域。
我敢打赌,谷歌搜索结果页面的 DOM 中的图像实际上是从他们自己的静态内容域 (gstatic) 提供的,而不是托管原始图像的实际网站 (icatcare.org)。
推荐阅读
- javascript - 在 Heroku 上成功部署 Node js 后,我遇到了应用程序错误
- swift - WebRTC Call 想运行拨号音
- arrays - 找出某些整数出现在Scala数组中的频率
- python - 找不到页面 (404) 请求方法:GET 请求 URL:http://127.0.0.1:8000/index.html/
- reactjs - 使用 react-native-ionicons 和 material-bottom-tabs 不显示反应原生图标(用十字显示)
- r - 联合概率
- reactjs - 测试期间未加载 Jest Mocked 数据
- amazon-web-services - AWS API Gateway MockIntegration 不接受 Content-Type `application/vnd.nasa.cmr.umm+json;version=1.6.3`
- python - 如何自定义 tkinter 下拉菜单?
- ios - 如何在swift中使用Google Material MDCOutlinedTextField从文本字段中删除占位符文本?