Crawling
[크롤링/10]Scrapy로 크롤링 대상 사이트에 피해주지 않는 설정하기
박한결
2021. 3. 25. 20:18
크롤러를 만들때 중요한건 크롤링 대상 사이트에 피해를 주지않는 것이다.
크롤러는 크롤링 할 사이트가 있어야만 존재할 수 있다.
그러므로 크롤링 대상에 피해를 주지 않기위한 Scrapy 설정들(클릭하면 공식 문서로 이동)
Settings — Scrapy 2.4.1 documentation
Here’s a list of all available Scrapy settings, in alphabetical order, along with their default values and the scope where they apply. The scope, where available, shows where the setting is being used, if it’s tied to any particular component. In that
docs.scrapy.org
- DOWNLOAD_DELAY(기본값: 0)
같은 웹 사이트에 여러번 요청을 보낼 때 요청 대기 시간 설정(1.0 권장)
- RANDOMIZE_DOWNLOAD_DELAY(기본값: True)
웹 페이지의 다운로드 간격 무작위로 설정 여부 지정
True일 경우 다운로드 간격 DOWNLOAD_DELAY*0.5 ~ DOWNLOAD_DELAY*1.5
- ROBOTSTXT_OBEY(기본값: False)
웹 사이트의 robots.txt를 따를지 여부 설정