Get_nvts no results

I’d like to get a list of nvt ids based on filter string but I don’t get any results
here is my code :

with Gmp(connection, transform=transform) as gmp:
      gmp.authenticate(username=uname, password=passwd)
      nvts = []
     nvts = gmp.get_nvts(filter_string='severity<2')

     for nvt in nvts.xpath('nvt'):
          output = nvt.get('id')

nvt in for loop is empty.
would you please help me ?

The problem was this line :
for nvt in nvts.xpath(‘nvt’):

the type of filter was info not nvt so it sould be changed to :
for nvt in nvts.xpath(‘info’):

1 Like