2010-02-22 6 views
2

의 html 스크립트 태그 내에서 누락 된 콘텐츠가있어, urlfetch.fetch 함수를 사용하여 지정된 URL을 가져올 때 일부 특수 HTML 코드에 대해 비어있는 컨텐츠를 찾았습니다. 예를 들어urlfetch.fetch 내 애플 리케이션에서 애플 리케이션 엔진

의 URL : 실제 HTML 소스에서 http://www.club.cn.sodexo.com/node/5071 , 코드가 포함이 :

<div class="content"> 
<div style="width: 219px; height: 262px;" id="gmap-auto3map-gmap0" class="gmap-control gmap-gmap gmap gmap-map gmap-auto3map-gmap">Javascript is required to view this map.</div> 
<script type="text/javascript"> 
/* <![CDATA[ */ 
jQuery.extend(true, Drupal, { settings: { "gmap": { "auto3map":{ "width": "219px", "height": "262px", "zoom": 16, "maxzoom": "17","controltype": "Large", "align": "None", "maptype": "Map", "mtc":"none", "baselayers": { "Map": 1, "Satellite": 1, "Hybrid": 1 },"styles": { "line_default": [ "0000ff", "5", "45", "", "" ],"poly_default": [ "000000", "3", "25", "ff0000", "45" ] },"line_colors": [ "#00cc00", "#ff0000", "#0000ff" ], "behavior":{ "autozoom": true }, "markermode": "0", "id": "auto3map", "latitude":"31.239132", "longitude": "121.483506", "markers": [ { "latitude":"31.239132", "longitude": "121.483506", "markername": "small red","offset": 0, "opts": { "title": "克莉丝汀食品(宁波路店)" }, "text": "\x3cdiv class=\"gmap-popup\"\x3e\x3c/div\x3e" } ] } } } }); 
/* ]]> */ 
</script> 
</div> 

하지만 가져올 URL을 통해 무엇을 가지고에서

: 는 결과는 다음과 같습니다

<div class="content"> 
<div style="width: 219px; height: 262px;" id="gmap-auto3map-gmap0" class="gmap-control gmap-gmap gmap gmap-map gmap-auto3map-gmap">Javascript is required view this map.</div> 
<script type="text/javascript"> 
/* <![CDATA[ */ 
/* ]]> */ 
</script> 

/* <![CDATA[ *//* ]]> */ 사이의 모든 자바 스크립트 코드를 놓친 경우, 그것은 매우 유선이다. 누구든지이 문제를 알고 있습니까? 이 문제를 해결할 수 있습니까?

+0

공식 Google 그룹 http://googles.google.com/group/google-appengine-python/browse_thread/thread/98fe927edd02128e에서 Google App Engine 팀의 개발자로부터 답변을 얻었습니다. User-Agent가 주요 원인이 될 수 있습니다. 그러나 내 컬 테스트에서 응답에는 자바 스크립트 코드를 포함한 모든 내용이 포함되어있었습니다. 지금까지는 더 이상 재생할 수 없습니다. – Taobility

답변

0

아마도 서버가 사용자 에이전트 (Firefox와 Internet Explorer의 코드가 다른 코드)를 기반으로 다른 자바 스크립트를 삽입하고 urlfetch의 사용자 에이전트의 경우 서버가 혼란스럽고 전혀 자바 스크립트를 삽입하지 않습니다.

관련 문제