Take a look at the history of the power loom which automated weaving in the 19th century. The number of handloom weavers dropped two orders of magnitude after the power loom.