1. 웹 크롤링! 정적, 동적 페이지!
소상공인분들의 입점처 주문서 수집을 자동화 할 일이 생겨버렸다!
일단은 해결 했던 사소해서 너무나 찾아다녔던, Pain point,, 공식 문서에서 설명하는 방식으로 이벤트 처리가 되지 않아서 이리저리 해매다 보니, 아래와 같이 webdriver와 script를 함께 사용하라더라, 다행히 해결!

2. DRF, SWAGER, SCRAPY, SELENIUM, BEAUTIFULSOUP, CELERY, REDIS, FLOWER, BEAT 등등 전통적인 방식의 크롤링을 진행한다!
설치 진행시켜!

pip install -r requirements.txt
대략 이런 모양세가 될 듯?!
myproject/
├── manage.py
├── myproject/
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
│ └── asgi.py
├── scraping/
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── tasks.py
│ ├── views.py
│ ├── urls.py
│ ├── models.py
│ ├── serializers.py
│ └── tests.py
├── mycrawler/
│ ├── __init__.py
│ ├── items.py
│ ├── middlewares.py
│ ├── pipelines.py
│ ├── settings.py
│ ├── spiders/
│ │ ├── __init__.py
│ │ └── dynamic_spider.py
│ └── __init__.py
├── celery.py
├── requirements.txt
├── Dockerfile
└── docker-compose.yml
scrapy startproject naver
scrapy genspider naver www.naver.com
scrapy(스크래피) 프로젝트 생성방법
scrapy crawl dynamic_spider
3. DRF에 SCRAPY 양념하기
scraping django app 과 service_crawler scrapy project를 프로젝트 루트 안에 생성!
django-admin startproject service_crawling_project
django-admin startapp scraping
scrapy startproject service_crawler