2 ms·
This is a problem that's near and dear to my heart, and more progress on standardizing URL parsing would be lovely. I have a crawler and a data miner that both
by thaumaturgy 10y ago
This is a problem that's near and dear to my heart, and more progress on standardizing URL parsing would be lovely. I have a crawler and a data miner that both rely on URL parsing, and it's kind of a pain. There are about a hundred tests that the code needs to pass with each revision, and it's only a fraction of the tests that are needed and there are still edge cases found in the wild.
For instance, telling the difference between a web uri and a mailto uri without the benefit of a scheme at the beginning of the uri is total guesswork.
The parser's current approach is to return parsed URIs along with a confidence percentage and the application logic then tries to make some additional guesses based on context.
URI parsing is not my favorite thing.