【发布时间】:2017-07-31 20:06:01
【问题描述】:
我之前发布了this 的问题,寻求有关python 脚本的帮助,但没有得到太多反馈,这没关系!因为我自己弄清楚了如何处理其中的大部分内容,但我遇到了一些麻烦。
我的脚本目前是这样的:
param1 =
param2 =
param3 =
requestURL = "http://examplewebpage.com/live2/?target=param1&query=param2&other=param3"
html_content = urllib2.urlopen(requestURL).read()
matches = re.findall('<URL>(.*?)</URL>', html_content);
myList=[matches]
i = 0
while i < len(myList):
testfile = urllib.URLopener()
testfile.retrieve(myList[i], "/Users/example/file/location/newtest")
i += 1
这成功地从网页中检索所有 URL,但我找不到继续下载过程的方法。我目前收到以下错误:'list' object has no attribute 'strip'
谁能想到更好的方法来做到这一点?或者除了列表之外,我应该使用其他数据类型吗?
【问题讨论】: