Space is too big, and the field of even the world's strongest electromagnets are too small for this to be practical. And even if it did work, you'd only collect ferromagnetic material.