Sometimes hamsters would pee on someone as a way of defence. It takes time to train your hamsters and she might have been scared when you picked her up.
If she doesn't bite, try to put treats on your hand and see if she'll walk on it to get the treat. Do it gradually, extending the distance between the treat and her until one day she'll feel confident enough to walk on the hand. Once they get comfortable with the hand, it's easier to scoop them up.
The other thing that worked for me is I put Maximo in a book shelf to explore. Whenever he wants to climb on top of the books, I offer my hand as a ladder. Now every time he wants to go in the book shelf, he goes to sit on my hand