TGStat
TGStat
Type to search
Advanced channel search
  • flag English
    Site language
    flag Russian flag English flag Uzbek
  • Sign In
  • Catalog
    Channels and groups catalog Search for channels
    Add a channel/group
  • Ratings
    Rating of channels Rating of groups Posts rating
    Ratings of brands and people
  • Analytics
  • Search by posts
  • Telegram monitoring
zi존파워잼민

18 Feb 2025, 15:30

Open in Telegram Share Report

다음은 buy탭과 sell탭을 따로 2개의 창으로 열어주셔야 합니다.

둘다 f12를 눌러 콘솔창을 열어줍니다.

밑에 첫번째 코드는 buy 탭 콘솔창에 넣어줍니다.

// 주어진 XPath에 해당하는 요소를 클릭하는 함수
function clickElementByXPath(xpath) {
try {
const element = document.evaluate(
xpath,
document,
null,
XPathResult.FIRST_ORDERED_NODE_TYPE,
null
).singleNodeValue;

if (element) {
element.click();
console.log(`클릭됨: ${xpath}`);
} else {
console.warn(`요소를 찾을 수 없음: ${xpath}`);
}
} catch (error) {
console.error(`오류 발생 (${xpath}):`, error);
}
}

// 무한 반복으로 순차 클릭을 실행하는 함수
async function runSequentialClicksInfinite() {
const xpaths = [
"//*[contains(@id, '-tab-buy')]",
"//*[contains(@id, '-tabpanel-buy')]/div/div/div[1]/div[1]/div[1]/div/div[1]/svg[2]",
"//*[contains(@id, '-tabpanel-buy')]/div/div/div[1]/div[1]/div[2]/button[5]",
"//*[contains(@id, '-tabpanel-buy')]/div/div/div[2]/button",
"//footer/div[1]/button" // footer 내의 버튼 선택 (필요에 따라 수정)
];

while (true) {
for (const xpath of xpaths) {
clickElementByXPath(xpath);
// 2초 대기
await new Promise(resolve => setTimeout(resolve, 2000));
}
}
}

// 실행
runSequentialClicksInfinite();

밑에 있는 코드는 sell 탭 f12열어 콘솔창에 넣어주시면 됩니다.

// 주어진 XPath에 해당하는 요소를 클릭하는 함수
function clickElementByXPath(xpath) {
const element = document.evaluate(
xpath,
document,
null,
XPathResult.FIRST_ORDERED_NODE_TYPE,
null
).singleNodeValue;

if (element) {
element.click();
console.log(`클릭됨: ${xpath}`);
} else {
console.warn(`요소를 찾을 수 없음: ${xpath}`);
}
}

// 무한 반복으로 순차 클릭을 실행하는 함수 (오류 발생 시에도 계속 실행)
async function runSequentialClicksInfinite() {
const xpaths = [
"//*[contains(@id, '-tab-sell')]/span",
"//*[contains(@id, '-tabpanel-sell')]/div/div/div[1]/div[1]/div[2]/button[5]",
"//*[contains(@id, '-tabpanel-sell')]/div/div/div[2]/button",
"//footer/div[1]/button"
];

while (true) {
for (const xpath of xpaths) {
try {
clickElementByXPath(xpath);
} catch (error) {
console.error(`오류 발생 (${xpath}):`, error);
}
// 2초 대기
await new Promise(resolve => setTimeout(resolve, 2000));
}
}
}

// 실행
runSequentialClicksInfinite();
더 이상 안하고 싶다면
원하실때 f5나 창을 닫으면 멈추게 됩니다.

총 창을 3개켜야하므로 좀 귀찮을 수도 있지만 켜놓고 다른걸 해도 자동으로 돌아가기에 코드를 공유해드립니다.

31 0 1 2 1
Catalog
Channels and groups catalog Channels compilations Search for channels Add a channel/group
Ratings
Rating of Telegram channels Rating of Telegram groups Posts rating Ratings of brands and people
API
API statistics Search API of posts API Callback
Our channels
@TGStat @TGStat_Chat @telepulse @TGStatAPI
Read
Академия TGStat Telegram Research 2019 Telegram Research 2021 Telegram Research 2023
Contacts
Справочный центр Support Email Jobs
Miscellaneous
Terms and conditions Privacy policy Public offer
Our bots
@TGStat_Bot @SearcheeBot @TGAlertsBot @tg_analytics_bot @TGStatChatBot