Finding a professor beforehand I want to know your opinion about the following situation.

Having read all recommendations on how to apply to graduate school abroad, how to choose the professor to work with, I found a really interesting suggestion of someone. The person was describing the similar process applying to graduate school and in parallel he was looking for someone to work with in the same university, a bit early but if know what do you want to do, why not to do it. Having found a good candidate to work with, the person offered to work together for from few weeks to few months. 

This person was lucky, he made a really good choice, they decided to proceed working together towards a masters degree and application to the university was a useless formality.

One minor point though, it was a quite expensive, to buy a fly ticket, rent a room etc.

What is your opinion about this form of finding a professor, do you have more examples like this?
Well, if you want to find a good professor to work with, you could search for the available professors in a certain university (online, in their website). 

After having all the names, you could "stalk" them online, find some of their papers, etc. Most of them (if not all) will have a webpage in which they post lots of information about themselves, such as, their papers, students they worked with, even their hobbies. You'll probably delete quite a few names that way.

You'll still have some professors names not crossed out. You can then try to e-mail the students they worked with and ask them what's their evaluation of said professor. 

Not sure if this is what you're looking for, sorry if it's not.