ENH: fixed pydot import problem, refactored the url extraction code