Thoughts, stories and ideas.

Dev's Diary

2019.08.03 토

[셋팅]

  • tmux : reload tmux source-file ~/.tmux.conf
  • vim : NERDTree, 세부 단축키 재셋팅
  • tmuxinator : gem으로 설치필요 (Ruby 설치), .config/tmuxinator/
  • Linux Server : 시간셋팅

[개발]

  • 환경관리 (package.json)
  • 직접 구현 > express 프레임워크 신세계 경험
  • Template Engine (PUG)
    : ${} - for(var i=0; i<5; i++)

[ETC]

  • 도메인 3rd 구매

2019.08.04 일

  • Cheerio 모듈 / Node.js에서 크롤링
  • jQuery 사용법
// 원본 html 구조
<div>
    <li class="web_page_list">
        <p class="number">0000</p>
        <p class="name">test</p>
    </li>
</div>
---

//모듈 추출
var request = require('request');
var cheerio = require('cheerio');
 
//request 모듈 사용
var url = '웹페이지주소';
request(url, function(err, response, body){
    //변수 선언
    var $ = jQuery = cheerio.load(body);
 
    //데이터 추출
    $('.web_page_list').each(function(item){
 
        var number = $(this).find('.number').text().trim();
        var name = $(this).find('.name').text().trim();
        console.log(number);
        console.log(name);
         
    })
});

2019.08.05 월

  • Node.js <> Mysql 연동 : 실시간 검색 파이썬 크롤링 > Mysql > Node.js 페이지 프론트 완료 참고
  • SELECT * FROM product ORDER BY idx DESC LIMIT 2
  • 기본적인 CSS 디자인 스타일 반영
  • (check) location.replace / location.href

2019.08.06 화

  • CSS : 디노마드 강좌 (2014.07)
  • 기본적인 사용
  • tmux 패널이동 단축키로 고생.. 적용안되는 키 C-,.;' [/ > 환경셋팅 마무리할 것

2019.08.07 수

2019. 08.08 목

2019. 08.10 토