自定义搜索API获取断开图像lin

2024-10-03 06:29:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我用自定义搜索搜索图像。我得到一些坏的图像链接作为回应。在

比如:

{
    u'kind': u'customsearch#result',
    u'title': u'Quality Sports Wallpapers, Sport', 
    u'displayLink': u'feelgrafix.com',
    u'htmlTitle': u'Quality <b>Sports</b> Wallpapers, <b>Sport</b>',
    u'snippet': u'We found 20 Images in \xabSports\xbb ...',
    u'htmlSnippet': u'We found 20 Images in \xab<b>Sports</b>\xbb ...', 
    u'link': u'http://feelgrafix.com/data/sports/sports-1.jpg',
    u'mime': u'image/jpeg', 
    u'image': {
        u'thumbnailWidth': 150,
        u'byteSize': 615337,
        u'height': 1075,
        u'width': 1768, 
        u'contextLink': u'http://feelgrafix.com/group/sports.html',
        u'thumbnailLink': u'https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRP5hPZFmKRSooaRzGqptPjUW8NSf6DNsyK7zECMQuEYN2F-lt1-P-1RAQs',
        u'thumbnailHeight': 91
    }
}

链接断了。如何使用自定义搜索restfulapi过滤断开的图像链接?在


Tags: in图像comhttp链接weimagesquality