问题是调用以识别call命令中的o.geturl()命令。
from subprocess import call
import time
from urlparse import urlparse
def ListOfTests():
myFile = open("testUrlToImport.txt", "r")
myLines = list(myFile)
myFile.close()
for urls in myLines:
urlsAsAString = str(urls)
o =urlparse(urlsAsAString)
call(["phantomjs", "yslow.js", "--info", "basic", "--format", "plain", "o.geturl()"])
任何指针都表示赞赏。谢谢!
答案 0 :(得分:2)
您应该从o.geturl()
中移除引号。这应该有效:
call(["phantomjs", "yslow.js", "--info", "basic", "--format", "plain", o.geturl()])