Skip to content

Instantly share code, notes, and snippets.

@eto
Created May 26, 2025 14:49
Show Gist options
  • Save eto/8673a6a338bb522d002760131974998f to your computer and use it in GitHub Desktop.
Save eto/8673a6a338bb522d002760131974998f to your computer and use it in GitHub Desktop.
# 「もっと見る」ボタンを自動的に押すスクリプト書いた
1. macOSのChromeを想定。まずTamperMonkeyを入れる。 https://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=ja&utm_source=ext_sidebar
2. 右上の拡張機能からTamperMonkeyを固定。「新規スクリプトを追加…」
3. エディターに以下を入れる。ファイル→保存
// ==UserScript==
// @name Expo2025 Auto Clicker
// @namespace http://tampermonkey.net/
// @version 2025-05-25
// @description もっと見るボタンを自動クリック
// @author Me
// @match https://ticket.expo2025.or.jp/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=expo2025.or.jp
// @grant none
// ==/UserScript==
(function() {
'use strict';
// 定期的に押せるボタンを探して押す
function clickButtonIfAvailable() {
// 「もっと見る」ボタンで、disabled属性がなく、deactiveクラスが付いていないものを探す
var btn = document.querySelector('button.style_more_btn__ymb22:not(.style_more_btn_deactive__jsP8I):not([disabled])');
if(btn) {
btn.click();
}
}
// 初回+0.2秒ごとにチェック
setInterval(clickButtonIfAvailable, 200);
})();
4. 空きパビリオン検索ページで「検索」を押すと、自動的に押せる間は「もっと見る」を0.2秒ごとに押し続ける。
以上
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment