파이썬 requests 모듈 사용 중 post의 응답값을 받아오는 것에 대한 질문입니다

익명 사용자의 이미지

안녕하세요 파이썬 초보자입니다.
논문 크롤링 프로그램을 만들고 싶어서 post 로 검색어를 넘겨주고 응답값을 받아오는 것부터 시작했습니다.
파이썬 requests 모듈 사용 중 post의 응답값을 받아오는 것에 대한 질문입니다.

=====================================================================================
언어: 파이썬
환경: ubuntu, vim 에디터
타겟 url: web of science 페이지
http://apps.webofknowledge.com/WOS_GeneralSearch_input.do
product=WOS&search_mode=GeneralSearch&SID=V2hrkXkh35vWk2rqrWu&preferencesSaved=
post name: value(input1) -> burp로 잡아서 파라미터에서 확인
=====================================================================================

그런데 응답값이 실제 응답 페이지와 다르게 나오고 어느 부분의 응답값인지는 모르겠습니다.
malware를 입력값으로 넘겨 주었을 시 나와야 하는 페이지와 다릅니다.
다른 모듈도 써보고(urllib,urllib2) response.content로도 써봤지만 똑같이 나오더군요!
도무지 이유를 모르겠습니다ㅜㅜ
(응답값은 너무 길어서 안올렸습니다)

아래는 코드이고 부족한 정보가 있다면 더 올리겠습니다.
긴 글 읽어주셔서 감사합니다.

  1 #-*- coding: utf-8 -*-
  2 import requests
  3
  4 url="http://apps.webofknowledge.com/WOS_GeneralSearch_input.do?product=WOS&s    earch_mode=GeneralSearch&SID=V2hrkXkh35vWk2rqrWu&preferencesSaved="
  5
  6 data={'value(input1)':'malware'}
  7 response=requests.post(url,data=data)
  8 text=response.text
  9
 10 print text

...!의 이미지

아마 알고 계실 것 같지만 혹시나 해서 우선 확인해둡니다. web of science는 라이센스가 있어야 접근할 수 있습니다. 아마 소속 기관 (학교?)에서 접속하시면 되겠지만 집에서는 안될 덥니다. 또 학교에서도 외부 업체가 제공하는 무선 네트워크 등을 사용하면 안되실 수 있습니다.

web of science는 페이지를 로딩한 다음에, 보이지 않게 주소창에 표시된 주소와 다른 주소로 추가적인 요청을 더 해서 데이터를 가져온 다음에 페이지를 업데이트해서 보여줍니다. 웹 브라우저에 그런 요청을 추적할 수 있는 기능이 있으니 사용해보세요. 예를 들어 파이어폭스라면 Ctrl-Shift-Q 를 누르고 페이지를 다시 로딩하면 어떤 요청들이 이루어지는 지 볼 수 있습니다. 이미지나 자바스크립트 파일, 스타일시트 등에 대한 요청 등등을 제외하고 잘 살펴보면 어떤 요청에서 실제로 데이터를 가져오는 알 수 있을겁니다.

이수림의 이미지

라이센스 때문인 걸 전혀 몰랐네요...;; 정말 감사합니다! 다시 해봐야겠네요 :)

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.