Update URLParser.py

Improve handling of IO failures and page detection