LONDON — “Hamilton” and the new “Harry Potter” play are the hottest theatrical shows of the moment, with “Hamilton” outgrossing everything else on Broadway, and Harry, Hermione and Ron drawing hordes of muggles to London’s West End.

But success has a side effect: Both shows have fallen prey to high-tech scalpers who harvest large quantities of seats and resell them at exorbitant markups. “Hamilton” has been hit particularly hard: When it first opened on Broadway, nearly 80 percent of seats were purchased by automated ticket bots, and for Lin-Manuel Miranda’s final performance, resellers were seeking an average of $10,900 a seat.

Now, as “Hamilton” prepares to open in London this fall and “Harry Potter” plans to open on Broadway next year, the producers of both shows are aggressively trying to contain scalping, a long-festering problem for the entertainment industry that has been exacerbated by technology. The producers of “Hamilton” are trying an unusual approach for theater — paperless ticketing — while the producers of “Harry Potter” are refusing to accept resold tickets.

And in the United States and Britain, policy makers are tackling the issue anew, concerned about the effect of industrialized scalping on consumers and artists.