LoginSignup
1
0

More than 3 years have passed since last update.

Javascript 覚書

Posted at

JavascriptでTinderのスワイプ自動でやるための基本操作

  1. 基本
  • くり返し系
    • setIntervalとsetTimeout
hoge.js
function hoge(){
 console.log('hoge');
}

setInterval(hoge(), 1000)
// 1000m秒間隔でhoge()を永遠にクリア返す

setTimeout(hoge(), 1000)
// 1000m秒間隔でhoge()を一回くり返す
  • 要素取得系(セレクタ)
hoge.js
Document.getElementBy~
//~はIDとかclassNameとか
Document.querySelector("~")
//Jqueryみたいにかける

getAttribute
//アトリビュート指定。(例:aria-label="いいね"のaria-label部分とか)


//Jqueryが埋め込まれてるサイトであれば、
$('')
//でいろんな要素取れる
//http://www.hp-stylelink.com/news/2013/11/20131122.php

//基本、要素に対してクリック
click();

追記
2020/3/15現在、setIntervalとかが禁止されていてできない。多分。

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0