[Çözüldü] Nerede hatam var?

Başlatan harunbas141, 15 Ağustos 2016 - 16:55:11

« önceki - sonraki »

0 Üyeler ve 1 Ziyaretçi konuyu incelemekte.

harunbas141

import urllib.request

url1 = "https://sendeyim.com/uploads/resim-galerisi/at-resimleri_184984.jpg"
url2 = "https://i1.imgiz.com/rshots/8951/resimler-cizelim-balik-cocuklar-icin-egitici-cizgi-film_8951611-3744_1800x945.jpg"
url3 = "https://sendeyim.net/uploads/resim-galerisi/gun-batimi-resimleri_83698.jpg"

urllistesi = [url1,url2,url3]
say=1

for url in urllistesi:
    urllib.request.urlretrieve(url, "Resim" + str(say)+ ".jpg")
    say +=1

Traceback (most recent call last):
  File "/home/harun/PycharmProjects/Calismalarim/modulornegi.py", line 11, in <module>
    urllib.request.urlretrieve(url, "Resim" + str(say)+ ".jpg")
  File "/usr/lib/python3.5/urllib/request.py", line 188, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 466, in open
    response = self._open(req, data)
  File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
    '_open', req)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 1297, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/usr/lib/python3.5/http/client.py", line 1106, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/usr/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/usr/lib/python3.5/http/client.py", line 1260, in connect
    server_hostname=server_hostname)
  File "/usr/lib/python3.5/ssl.py", line 377, in wrap_socket
    _context=self)
  File "/usr/lib/python3.5/ssl.py", line 752, in __init__
    self.do_handshake()
  File "/usr/lib/python3.5/ssl.py", line 988, in do_handshake
    self._sslobj.do_handshake()
  File "/usr/lib/python3.5/ssl.py", line 638, in do_handshake
    match_hostname(self.getpeercert(), self.server_hostname)
  File "/usr/lib/python3.5/ssl.py", line 297, in match_hostname
    % (hostname, ', '.join(map(repr, dnsnames))))
ssl.CertificateError: hostname 'sendeyim.com' doesn't match either of 'server.sendeyim.com', 'www.server.sendeyim.com'


nerede hata var arkadaşlar?resimler inmedi.

FireSwords

Site sertifika hatası vermiş. Sendeyim.com linkindeki https kısmını http olarak değiştir.

harunbas141

Traceback (most recent call last):
  File "/home/harun/PycharmProjects/Calismalarim/modulornegi.py", line 11, in <module>
    urllib.request.urlretrieve(url, "Resim" + str(say)+ ".jpg")
  File "/usr/lib/python3.5/urllib/request.py", line 188, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.5/urllib/request.py", line 504, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 696, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.5/urllib/request.py", line 510, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden


bu seferde böyle hata verdi aynı hata

FireSwords

#3
url3 linki çalışmıyor. Kaldırırsan düzelir.




Mesaj tekrarı yüzünden mesajınız birleştirildi. Bu mesajın gönderim tarihi : 15 Ağustos 2016 - 17:04:20

Konuyla ilgili bunu buldum. Belki işine yarayabilir:

https://stackoverflow.com/questions/22758031/how-to-disable-hostname-checking-in-requests-python

harunbas141

yardımın için teşekkür ederim.verdiğin linke bakacağım ama sorun linklerdeymiş