Why not just use the Yahoo! GeoPlanet service to resolve a place to a WOEID? Or use the YQL service to access GeoPlanet via it's table?
http://where.yahooapis.com/v1/places.q('Barrie CA')?appid=[yourappidhere]
or
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20text%3D%22Barrie%20CA%22&format=xml
No need for scraping.
Cheers
G
(Disclosure; I work for Yahoo! and am part of the group behind WOEIDs and GeoPlanet)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…