Update Python algorithm for search HTTP resource in string