我需要格式化一个字符串,并将其发送到带有splinter模块的web浏览器。 我通常使用占位符,但这次不起作用。 这是我要传递给浏览器的字符串:
http://NAMESERVER:8082/ViewObjectRes//TransactionLogManagerPostErrorHandling\%28Instance+0\%29\%3Ainstance\%3DInstance+0
其中NAMESERVER是我要连接到的服务器的fqdn。 我像往常一样尝试使用占位符,但出现了一个错误:
print ("http://%s:8082/ViewObjectRes//TransactionLogManagerPostErrorHandling\\%28Instance+0\\%29\\%3Ainstance\\%3DInstance+0" % "TEST")
TypeError: not enough arguments for format string
我想我应该避开其他的百分号,但我尝试了却没有成功。你知道吗
使用包含
%
的url格式可能更容易?你知道吗相关问题 更多 >
编程相关推荐