For obstacle detection you would usually use a different IR sensor, yes. The IR sensors usually used for line following only work at a very short range (typically <1cm). For a robot detecting obstacles you want a sensor that detects an obstacle further away, say at a 30-60 cm distance, so the robot can evade the obstacle before it runs into it.
Common IR sensors for obstacle detection look like this:
The IR sensor you showed probably send a 0V or 5V, true or false value to a digital input of your arduino. The IR distance sensor shown above sends an analogue value (range 0-5v) to an analogue input of an arduino. They come in different ranges. Ranges go from ± 10 cm to ±5m (rough indication).
But personally I prefer to use the common HC-SR04 ultrasonic distance sensor instead of infrared ones. They have a larger usable range, a less noisy signal and detect more different types of objects. That's my personal experience from side-by-side comparison.
I'm reluctant to mention online shops on where to buy them. They're very common sensors.