Enum extension + some other scraping fixes

what happens if there are trailing white spaces after `optional` in `type_str`