We show that the complex absorbing potential (CAP) method for computing scattering resonances applies to an abstractly defined class of black box perturbations of the Laplacian in R n which can be analytically extended from R n to a conic neighborhood in C n near infinity. The black box setting allows a unifying treatment of diverse problems ranging from obstacle scattering to scattering on finite volume surfaces.