An efficient and automated waste collection system can facilitate the overall waste management of any smart city. Many IoT-based techniques are developed to make waste collection system optimized and autonomous. However, none of them considers any situation when IoT-based technique could fail to transfer data due to any unforeseen reasons (e.g, natural calamity, poor maintenance, device failure, connection outage, etc.). In this work, we propose an IoT-based technique named WasteMiner for collecting waste in an efficient way where we also calculate the shortest distances between the waste bins for making the system fuel and time efficient. Moreover, we collect data of waste levels of the bins and apply data mining technique to the collected data for extracting important information. This information help us collecting waste in an efficient way in the case of any system failure in the IoT-based network of WasteMiner. Our experimental results show that WasteMiner is effective and efficient when, i) IoT-based system functions properly, ii) any system failure or communication problem occurs, and iii) if scaled up properly, can be applicable to real-world systems by integrating WasteMiner as one of the key smart city components.