我正在使用google safebrowsing api,以及以下代码:
def getlist(self, type):
dlurl = "safebrowsing.clients.google.com/safebrowsing/downloads?client=api&apikey=" + api_key + "&appver=1.0&pver=2.2"
phish = "googpub-phish-shavar"
mal = "goog-malware-shavar"
self.type = type
if self.type == "phish":
req = urllib.urlopen(dlurl, phish )
data = req.read()
print(data)
生成以下回溯:
^{pr2}$我做错什么了?我看不出三个论点在哪里被通过。 顺便说一句,我打电话给
x = class()
x.getlist("phish")
功能urllib.urlopen打开由URL表示的网络对象以进行读取。如果URL没有方案标识符,它将打开一个文件。在
在第88行调用适当的开启器,这将导致209处的opener open_文件。在
如果你看一下函数:
回答:你应该提供一个类似http://。。。在
基本上,您没有在url中提供方法,因此Python假设它是一个文件url,并试图将其作为一个不起作用的文件打开(并在失败的过程中抛出一个令人困惑的错误消息)。在
尝试:
相关问题 更多 >
编程相关推荐