【发布时间】:2021-03-04 23:45:55
【问题描述】:
class ContentCallback:
def __init__(self):
self.contents = ''
def content_callback(self, buf):
self.contents = self.contents + buf
def exploitdb_search(name):
if len(name) != 0:
query = str(name) + ' ' + 'site:https://www.exploit-db.com/'
for data in search(query, num_results=1):
if "https://www.exploit-db.com/exploits" in data:
x = ContentCallback()
c = pycurl.Curl()
c.setopt(c.URL, '{}'.format(data))
c.setopt(c.WRITEFUNCTION, x.content_callback(data))
c.perform()
c.close()
print(t.content)
【问题讨论】:
-
你有什么问题?
-
您在哪里定义
t中使用的print(t.content)? -
我的问题是为什么当我使用 setopt 并拒绝在此处显示数据时它一直给我这个关于 unsetopt() 的错误 c.setopt(c.WRITEFUNCTION, x.content_callback(data))
-
不,是 x,我没改,我的错