As for my knowledge, the object in a sentence is used to talk about the thing or person that the verb is done to or who receives the verb.
For example :
I put the orange cat into the garden.
With this sentence, it's easy to identify the
object which is the orange cat where the orange cat is the one who receives the verb.
But, how about this :
She was so unpopular that few people visited her in the hospital when she was ill.
I was confused and unsure which one is the object. Is it few people or her? or since the verb here is
visited so the object in the sentence is her?