»Ë»Ñ Æ÷·³
°³¹ßÀÚÆ÷·³ ÀÔ´Ï´Ù.
  • ºÏ¸¶Å© ¾ÆÀÌÄÜ

ÆÄÀ̽ã urllib.request Áú¹® µå¸³´Ï´Ù.3

  • ±ÛÀÛ
  • µî·ÏÀÏ 2015-05-15 15:34
  • Á¶È¸¼ö 987
¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ
import urllib.request

def website(add):
    page = urllib.request.urlopen(add)
    text = page.read().decode('utf8')
    print (text)

¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ¤Ñ

ÀϹÝÀû »çÀÌÆ®´Â Àß ±Ü¾î¿É´Ï´Ù.

±×·±µ¥


http://map.naver.com/local/siteview.nhn?code=11813800

ÀÌ·± ÁÖ¼Ò´Â ¾È±Ü¾îÁö³×¿ä.

ƯÁ¤ ÁÖ¼Ò¸¦ °¡Á®¿À°í ½Í¾î¼­
http://map.naver.com/local/siteview.nhn?code= ¿Í 11813800¸¦ ºÐ¸®Çؼ­ µÚ ¼ýÀÚ ºÎºÐ¸¸ º¯°æÇϸ鼭 ÁÖ¼Ò¸¦ ±Ü¾î¿À·Á°í Çϴµ¥

ÀÌ ÁÖ¼Ò ÀÚü°¡ ¾È±Ü¾îÁö´Ï ½ÃµµÁ¶Â÷ ¸øÇÏ°í ÀÖ½À´Ï´Ù.

¿Ö ÀÌ ÆäÀÌÁö´Â

Traceback (most recent call last):
  File "", line 1, in
    website('http://map.naver.com/local/siteview.nhn?code=11813800')
  File "C:/Users/2635/Desktop/site.py", line 4, in website
    page = urllib.request.urlopen(add)
  File "C:Python34liburllibrequest.py", line 161, in urlopen
    return opener.open(url, data, timeout)
  File "C:Python34liburllibrequest.py", line 469, in open
    response = meth(req, response)
  File "C:Python34liburllibrequest.py", line 579, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:Python34liburllibrequest.py", line 507, in error
    return self._call_chain(*args)
  File "C:Python34liburllibrequest.py", line 441, in _call_chain
    result = func(*args)
  File "C:Python34liburllibrequest.py", line 587, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

ÀÌ·± ¿À·ù¸¦ ¹ñ¾î³»´ÂÁö ±Ã±ÝÇÕ´Ï´Ù.

0
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
|
°øÀ¯¹öÆ°

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ¿¡½ºÅ×¹Ýa

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ±ÛÀÛ

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ±ÛÀÛ
  • ¾Ë¸² ¿å¼³, »óó ÁÙ ¼ö ÀÖ´Â ¾ÇÇÃÀº »ï°¡ÁÖ¼¼¿ä.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û ¸ñ·Ïº¸±â