Well there's copyright law. There's already lawsuits happening so we'll have to see how this shakes out.
But even if the AI companies lose the lawsuits, I think it's likely they'll still have access to content where the T&C of the site says they're allowed to sell the data.