How to use Cheerio to get certain value

Hello, I’m trying to get the value of profileId and store it in array, however I’m uncertain of how to target it: A div with h2 inside and then an <‘a’>, so I want to get the profileId value

<'a' ui-sref="profile.detail({profileId: 3944609 })">Lennie Candis

I actually went with just finding the h2 value, so basically the full name, as there are dozens of instances, I receive the text back as string almost ready to be converted in array, once I figure out how to deal with the many white spaces, but would love to be able to get only the profileId value, although it doesn’t seem as an option