在Google App Engines中,如何在Python中显示获取的URL的页面的HTML源代码? [英] In Google App Engines, how to display the HTML source of a page of a fetched URL in Python?
本文介绍了在Google App Engines中,如何在Python中显示获取的URL的页面的HTML源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Google App Engine上,我发现这个代码正在获取网页的网址:
from google.appengine.api import urlfetch
url =http://www.google.com/
result = urlfetch.fetch(url)
if result.status_code == 200:
doSomethingWithResult(result .content)
这是正确的代码来检查页面的HTML源代码吗? 结果变量是否包含 http://www.google.com/