【发布时间】:2013-05-14 01:10:22
【问题描述】:
我希望使用 python 请求一个网页并将源代码转换为字符串(我的页面只有文本,例如 Year2012,没有 html 或其他代码,所以如果你查看源代码,你会看到 Year2012,这就是我需要的)
例如,我在 Python 中有我想要的这个 C# 代码:
string WebClient = new WebClient().DownloadString(WebPage);
如果我创建 myscript.php 并输入 Year2012 string WebClient will be = "Year2012" 如果我稍后更改它并且我的程序检查网页,它将是我更改的内容。我想要同样的东西在 windows 的 python 中你知道怎么做吗?
谢谢!
【问题讨论】:
标签: python python-2.7 python-2.6