fork(5) download
  1. import requests
  2.  
  3. roffjfl = 'programming'
  4. qjsgh = '406537'
  5.  
  6. res = requests.get('http://g...content-available-to-author-only...e.com/board/lists/?id=' + roffjfl)
  7. cookie = res.headers['set-cookie']
  8.  
  9. #CI_C값 추출.
  10. st = cookie.find("ci_c")
  11. ed = cookie.find(";", st)
  12. cookie = cookie[st+5:ed];
  13.  
  14. #http 헤더
  15. httpHeaders={"Accept": "*/*"
  16. ,"Accept-Encoding": "gzip:deflate:sdch"
  17. ,"Accept-Language":
  18. "ko-KR:ko;q=0.8:en-US;q=0.6:en;q=0.4"
  19. ,"Connection": "keep-alive"
  20. ,"Content-Type":
  21. "application/x-www-form-urlencoded; charset=UTF-8"
  22. ,"Host": "gall.dcinside.com"
  23. ,"Origin": "http://g...content-available-to-author-only...e.com"
  24. ,"Referer":
  25. "http://g...content-available-to-author-only...e.com/board/view/?id="+roffjfl+"&no="+qjsgh
  26. ,
  27. "User-Agent":
  28. "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML: like Gecko) Chrome/30.0.1599.101 Safari/537.36"
  29. ,"X-Requested-With": "XMLHttpRequest"}
  30.  
  31. #post데이터
  32. postdata = dict(id=roffjfl, no=qjsgh, memo='테스트', ci_t=cookie, name='ㅇㅇ', password='123123' )
  33.  
  34. post = requests.post('http://g...content-available-to-author-only...e.com/forms/comment_submit', data=postdata,headers=httpHeaders)
  35. print(post.text)
Runtime error #stdin #stdout #stderr 0.1s 10104KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
ImportError: No module named requests