
上QQ阅读APP看书,第一时间看更新
Scraping and crawling
Scraping (or web scraping) is a technique to extract information from websites. When we do not have access to APIs, we can only retrieve visible information from HTML generated on a web page. In order to perform the task, we need a scraper that is able to extract information that we need and structure it in a predefined format. The next step is to build a crawler—a tool to follow links on a website and extract the information from all sub pages. When we decide to build a scraping strategy, we have to take into consideration the terms and conditions, as some websites do not allow scraping.
Python offers very useful tools to create scrapers and crawlers, such as beautifulsoup and scrapy.
pip3 install bs4, scrapy