Created
January 3, 2023 00:26
-
-
Save nanpuhaha/ae017e113ee2124746d7ca89e0abd867 to your computer and use it in GitHub Desktop.
AIHub에서 자동으로 더보기 버튼을 눌러서 전체 목록 보기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AIHub 전체 목록 (자동 더보기) | |
// @namespace http://aihub.or.kr/ | |
// @version 0.1 | |
// @description AIHub에서 데이터셋을 찾을때, 자동으로 더보기 버튼을 눌러서 전체 목록 보기 | |
// @author Jangwon Seo | |
// @match https://aihub.or.kr/aihubdata/data/list.do?* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=aihub.or.kr | |
// @grant none | |
// ==/UserScript== | |
function clickBtn(btn) { | |
if (btn) { | |
btn.click(); | |
} | |
} | |
function getBtn() { | |
return document.querySelector('#dataSetMoreBtn'); | |
} | |
(function() { | |
'use strict'; | |
let clickInterval = setInterval(() => { | |
let moreBtn = getBtn(); | |
if (moreBtn.style.display === 'none') { | |
clearInterval(clickInterval); | |
} | |
clickBtn(moreBtn); | |
}, 100); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment