EasySelect icon indicating copy to clipboard operation
EasySelect copied to clipboard

无法提取到内容

Open wcmiracle opened this issue 2 years ago • 3 comments

请问这是我的使用方法不对吗,为什么提取不到正确的内容数量呢

image

wcmiracle avatar Mar 19 '23 04:03 wcmiracle

这个插件的用法是,构造相应的css selector

image

比如你在这里点一点,然后就能通过几级关系锁定所有的歌曲条目,而不会选择到其他的a元素。

后面写一小段js就能抽出你要的文本了。

fy0 avatar Mar 19 '23 10:03 fy0

我能理解css选择器的概念,按照上图所示,至少能选出200个a元素不是吗,可是我只选出了26个。而且还不包含歌曲条目

https://music.163.com/#/discover/toplist?id=3778678

wcmiracle avatar Mar 19 '23 12:03 wcmiracle

我能理解css选择器的概念,按照上图所示,至少能选出200个a元素不是吗,可是我只选出了26个。而且还不包含歌曲条目

https://music.163.com/#/discover/toplist?id=3778678

你说得对,可能这个项目过去有点久,统计的数字不准确了。 image

不过拿到的css选择器仍然可用,我后面有空修复一下:

document.querySelectorAll("div > div > div.ttc > span.txt > a").forEach(x => console.log(x.innerText))

image

fy0 avatar Mar 19 '23 17:03 fy0