I agree...the worst thing to do is to struggle and try to pull free. If you try to pull your hand away, she will find it very entertaining, because you are acting like prey.
Another thing to consider...it sounds like she used to let you pet her without biting. Has anything changed that she is upset about? Is it possible that she isn't feeling well or that she has skin problems that make it uncomfortable to be touched? Just something to think about.
If you would like to increase the time you can pet without being bitten, try the following technique:
1. Get a clock or watch with a second hand. Sit down and pet your cat watching to see how long you can pet without being bitten. Once you have done this a few times, you will have a good idea what her limit is.
Now that you know how long she can tolerate being petted, you are ready for the next step.
2. Lets say she let you pet her for 2 minutes. What you do now is (using your watch to time things) pet her for only 1.5 minutes and then stop even though she is still purring and happy. Do this every time she gets in your lap for several days. (Of course, if she can tolerate 4 minutes, you would stop at 3.5 minutes of petting, etc) Just make sure that you always stop before she becomes upset!
3. Now, after a couple of days of successful petting, you can begin to GRADUALLY add time. Each day, add about 20 - 30 seconds to your petting until she can sit with you and not bite. If she ever does bite, go back to the previous length of successful petting and stay there for a couple more days before adding more time.
This is a bit tedious (especially having to watch the clock), but it really does work!