关于pcrdfans的网页元素分析
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/450
//获得数量
//20
$('#battle_chara_select > div > div:nth-child(1) > div.ant-collapse-content.ant-collapse-content-active > div').children().length;
//17
$('#battle_chara_select > div > div:nth-child(2) > div.ant-collapse-content.ant-collapse-content-active > div').children().length;
//18
$('#battle_chara_select > div > div:nth-child(3) > div.ant-collapse-content.ant-collapse-content-active > div').children().length;
//获得坐标
//第一框
$('#battle_chara_select > div > div:nth-child(1) > div.ant-collapse-content.ant-collapse-content-active > div > div:nth-child(1)').css('background-position');
//第二框
$('#battle_chara_select > div > div:nth-child(2) > div.ant-collapse-content.ant-collapse-content-active > div > div:nth-child(1)').css('background-position');
//第三框
$('#battle_chara_select > div > div:nth-child(3) > div.ant-collapse-content.ant-collapse-content-active > div > div:nth-child(1)').css('background-position');
//通过坐标截图,然后比对图,获得相似度最高的元素的(选择器值)
//点击对应角色
一般项:
<div style="width: 50px; height: 50px; background-image: url("/static/sprites/charas.png?t=20200831"); background-size: 622px; background-position: -260px -156px;"></div>
This article was last edited at 2020-09-02 19:00:51