better regex; urllib.request and user-agent added