That is quite feasible.
You have to send the output of the souncard to a power amp that drives the speaker; I would recommend being very cautious about levels, it's so easy to fry a tweeter! Typically, speaker measurements are carried out at 2.83V RMS (1W nominal into 8 ohms); for frequency response measurements, level is not critical.
Then you need to pick up the signal at the driver's terminals. That's the part that must be thoroughfully thought.
The signal must be attenuated in order to not saturate the soundcard's input. The degree of attenuation depends very much on the characteristics of te soundcard. A typical SoundBlaster card has microphone level inputs that saturate with only a few millivolts, whilst semi-pro soundcards have line level inputs that accept levels up to several volts.
This information is paramount for "designing" the attenuator. Said attenuator is going to be of teh "L" type, which consists in just two resistors or alternatively a potentiometer.
A L-type attenuator can be calculated on-line. The sum of the values of the resistors (or the potentiometer's nominal value) must be significantly higher than the speaker's nominal value. Typically 10kohms is satisfactory, but 5k and 20k also. It is not critical.
OTOH, the value must be in the same order of value or lower than the souncard's input impedance (generally a few kilohms).
Now, one must identify precisely what terminal of the driver is the cold (ground) and what is "hot".
Connecting the ground terminal of the sound card to the "hot" speaker terminal results in injecting current in the soundcard's ground circuit, which can damage it seriously.
For a minimum risk of error, the soundcard ground terminal should be connected to the cold terminal of the speaker, and the souncard's input should be connected to the driver's "hot". In the absence of certainty, probing the two driver's terminals should show one with no signal and the other active, which obviously the correct one.
Beware that some speakers do not confirm to this simple scheme.
For example speakers with time-correction APF's (All Pass Filter) have signal on both sides of the driver(s).
Another case is for amplifiers with BTL outputs; thses amps have signal on both terminals. I would recommend not using that type of amp for measurements.
In both cases, the measurement must be taken differentially, which is possible if the soundcard has balanced inputs. In that case, the attenuator would be a U-type.