The passage of the BOTS Act is the result of years of frustration among members of the public as well as artists and producers irritated by an industry that profits from their work. In an interview, Jeffrey Seller, the lead producer of “Hamilton,” called scalping “a usurious, parasitic business that only serves to create a new profit center between the artist and the consumer.”

This year, an investigation by the New York State attorney general found abuses like a single scalper buying more than 1,000 tickets in under a minute for a U2 concert at Madison Square Garden. Ticket bots are illegal in New York, and last month Gov. Andrew M. Cuomo signed a law increasing penalties for their use.

In Britain and Europe, there has been significant political momentum to reform ticketing laws. The British government commissioned a major report on the scalping industry there, and lawmakers in Italy are considering proposals to curtail ticket reselling after reports that the head of the Italian branch of Live Nation, the global concert company, was funneling tickets directly to the secondary market.

In the United States, that progress has been much slower. While few spoke against the BOTS Act — the National Association of Ticket Brokers, which bars bots among its members, welcomed the bill — ticket scalping has become a standard part of the entertainment economy, and services like StubHub are often welcomed by fans for their convenience. Economists frequently endorse secondary markets as a true demonstration of supply and demand.

Supporters of the BOTS Act believe it could aid law enforcement in ways that were unavailable before. In 2010, federal prosecutors charged a group of men operating as Wiseguy Tickets with fraud for evading online ticketing safeguards in acquiring more than a million tickets that were resold for $25 million in profit. But the case hinged on whether the men had violated federal laws or merely run afoul of TicketMaster’s terms of service, and the Wiseguy operators received only probation.

The BOTS Act would make it illegal to bypass an online security system like TicketMaster’s.

“Laws don’t stop every crime, but the fact that there are new civil penalties for circumventing the technology that tries to keep tickets in the hands of fans will create a disincentive,” said Daryl P. Friedman, the chief advocacy and industry relations officer of the National Academy of Recording Arts and Sciences, the organization behind the Grammy Awards, which lobbied for the bill.

Yet even the BOTS Act’s biggest supporters acknowledge that as much as they welcome the proposed law, it alone will not end the problems of online ticket scalping.

“Is this the exact bill I would write? No. Is it imperfect? Of course,” said Mr. Seller, the “Hamilton” producer. “Is it better than nothing? You bet.”