When you are using python to crawl some sites, one thing you must do is to extract urls from html text. You can use BeautifulSoup to extract href value, however, in this tutorial, we will introduce how to extract urls by python regular expression, which is much faster than BeautifulSoup.