How to check if a link is a file or document while using Selenium? : I am making a web crawler using selenium in Python3.5, the problem I am having is that while crawling it clicks on the links that are some sort of file like ".pdf" or ".zip" or ".exe". I have already tried looking for these strings in the links and most of the time it works but I want 100% results. What should I do?