<div class="Thumbnail__thumbnail___3ABuK Thumb__thumbnail___jO6WM Video__thumbnail___2vJC9">
<img alt="alttext" src="https:/">
<div class="Duration__duration___qiPOI">14:57</div></div>
window.external.menuArguments.event.srcElement.innerHTML;
给出上述结果。然后如何获取img的alt值?
(我正在使用
window.ActiveXObject("WScript.Shell")
答案 0 :(得分:0)
似乎唯一的方法是操纵字符串;
var alt = window.external.menuArguments.event.srcElement.innerHTML;
if (alt.search("img alt=") > 0) alt = alt.substring(alt.lastIndexOf('img alt="') +9, alt.lastIndexOf('src') -2);
[04.07.2018]我终于找到了;
window.external.menuArguments.event.srcElement.getElementsByTagName('img')[0].alt;