LoginSignup
1
1

More than 5 years have passed since last update.

よく使う記述のメモ

Last updated at Posted at 2018-03-13

調査とかでよく使う記載のメモ帖

リンク先から特定の要素を抽出してコンソールにあれするあれ

listAre
$('リスト要素').each(function(index) {
    var thisLink = $(this).find('a').attr('href');
    $.ajax({
         type: "GET"
        ,url: thisLink
    }).done(function( msg ) {
        var thisObj = $(msg);
        var thisDetail = thisObj.find('ぶっこぬき対象のセレクタ').text();
        console.log( thisLink + ':' + thisDetail );
    });
});

facebookのコメント欄のデータを区切り文字で区切って抽出するあれ

あれする前に jQueryソース( https://code.jquery.com/jquery-1.11.3.min.js )を Consoleに貼る

facebookAre
// .UFIContainer のIDを使う
$('#(コメントのラッパー要素のID) ._3b-9 .UFIRow').each(function(index) {
    var tSep = '<>';
    var thisAre = tSep + index;
    thisAre += tSep + $(this).find(".UFICommentActorName").attr("href");
    thisAre += tSep + $(this).find(".UFICommentActorName").text();
    thisAre += tSep + $(this).find(".UFICommentBody span").text();
    thisAre += tSep + $(this).find(".uiLinkSubtle abbr").attr('title');
    console.log(thisAre);
});
1
1
0

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
1