Other than the solution that has been applied, there are two other options:
Well yeah. That will happen in war.
And you being okay with that....
Tell me, would you risk your own and your kids' lives to kill 100 people who have been targeting you with poorly made explosives by trying to extract these 100 people from a crowd of 1000 ? Or would you just press a button, putting you and your kids out of harms way, knowing the result would be that these 100 people would end up dead and their weapons destroyed, along with an unpredetermined(is that a word?) amount of innocent people who you could warn of the attack beforehand, and hope that they won't be there when it happens?
2. Because the Hamas rockets clearly do diddly squat.
How many people have died from Gaza rockets into Israel? | Mondoweiss
I'll say it again, It doesn't matter how many lives are in danger. One Israeli life to Netanyahu should be worth 100000000 lives of anyone else who is a danger to that one life. The same could be said for Hamas. One Palestinian life for Hamas should be worth 100000000 lives of any other people who is a danger to that one life.
The difference? Hamas doesn't care about Palestinian life. They hate Israelis more than they love each other, which is why they continue to fire in the first place.