AoA brothers.

Every now and then I have a question which I can not seem to find an answer to or which I want to confirm and then I turn my head towards this forum and AlhmadulillAllah usually get an answer which I accept.

Anyway's my question is that is buying/selling things for parts halal when it is unclear and unknown to the buyer and/or seller which "parts" work and can be salvaged is unclear?

I ask this because I know that it is haram to , for example, buy a bag of toys such that you don't know before hand what 'toys' are in the bag and the toys may be worth more or less than the price of the bag . This is because it is similar to gambling.

So, for example, is buying a non-working phone to salvage it's parts when you don't know which parts of the phone are functional/non-functional haram? I ask this because it "seems" like it is something that would be halal but if you have no idea what parts work or not, and you buy it hoping to gain a profit by salvaging its parts (and you may not get a profit if a lot of parts are damaged) , then this becomes very similar to gambling.