ip = 'localhost'
port = 0
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, ip, port)
socket.socket = socks.socksocket
url = (
    'http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=inurl%E8%A2%8B'
    )
print(requests.get(url).text)
How to make python Requests work via socks proxy