RPA/Crawling(Elements 접근 및 사용)

[javascript] 전자조달시스템(srm.kepco.net) 입찰공고 크롤링

테리베리 2022. 4. 15. 17:36
728x90
반응형

전자조달시스템(srm.kepco.net) 입찰공고 크롤링

 

1.

srm.kepco.net/index.do 열기

 

2. 정보공개 메뉴 클릭

document.getElementById('button-1107-btnInnerEl').click();

 

3. 통합공고 클릭

document.getElementById('menuitem-1109-textEl').click();

 

4. 조회 클릭

document.getElementById('button-1200-btnInnerEl').click();

 

5. // 확대를 25%로 조절하기

 

6. 반복문필요(1번 항목 세부사항 접근) // length확인은 document.getElementById('gridview-1218').getElementsByTagName('div')[1].getElementsByTagName('table').length;

document.getElementById('gridview-1218').getElementsByTagName('div')[1].getElementsByTagName('table')[0].getElementsByTagName('tr')[0].getElementsByTagName('td')[0].getElementsByTagName('div')[0].click();

document.getElementById('gridview-1218').getElementsByTagName('div')[1].getElementsByTagName('table')[1].getElementsByTagName('tr')[0].getElementsByTagName('td')[0].getElementsByTagName('div')[0].click();

document.getElementById('gridview-1218').getElementsByTagName('div')[1].getElementsByTagName('table')[2].getElementsByTagName('tr')[0].getElementsByTagName('td')[0].getElementsByTagName('div')[0].click();

...

document.getElementById('gridview-1218').getElementsByTagName('div')[1].getElementsByTagName('table')[2].getElementsByTagName('tr')[0].getElementsByTagName('td')[0].getElementsByTagName('div')[0].click();

 

           7. 공고명: document.getElementById('textfield-1254-inputEl').value;

              공고신청마감일시: document.getElementById('ext-comp-1374-inputEl').value;

             

                     8. 첨부파일 반복문 필요 // length확인은 document.getElementById('gridview-1545').getElementsByTagName('div')[1].getElementsByTagName('table').length;

                                document.getElementById('gridview-1545').getElementsByTagName('div')[1].getElementsByTagName('table')[0].getElementsByTagName('tr')[0].getElementsByTagName('td')[0].getElementsByTagName('div')[0].textContent;

                                document.getElementById('gridview-1545').getElementsByTagName('div')[1].getElementsByTagName('table')[1].getElementsByTagName('tr')[0].getElementsByTagName('td')[0].getElementsByTagName('div')[0].textContent;

 

           8. 뒤로가기

           document.getElementById('button-1601-btnInnerEl').click();

 

728x90
반응형