urlfetch.fetch获取在app engin的html脚本标记中丢失了内容

2024-10-01 15:45:00 发布

您现在位置:Python中文网/ 问答频道 /正文

在我的应用程序中,当我使用urlfetch.fetch获取函数获取一个指定的url,我发现我得到的内容是空的一些特殊的html代码。在

例如,url:http://www.club.cn.sodexo.com/node/5071 在真正的html源代码中,代码包括:

<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 fetch得到的信息来看: 结果是:

^{pr2}$

/* <![CDATA[ *//* ]]> */之间的所有javascript代码都丢失了,这是非常有线的。有人知道这个问题吗?有可能解决这个问题吗?在


Tags: 代码textdividurlmaphtmlscript

热门问题