Update linkextractor.py

Some makeup and try/except block.