My goal is to select all photos in
You can check out your own whatsapp web version by
- going to web.whatsapp.com
- authenticate
- open up a chat
- click on top of the chat
- click on media
CodePudding user response:
If it has to do something with the mouseover
(or maybe the mouseenter
) event, this might be worth a shot:
const mouseoverEvent = new Event('mouseover');
document.querySelectorAll("._23fpc").forEach(s => s.dispatchEvent(mouseoverEvent));
If it works, you can go on with the code you provided.
CodePudding user response:
Since you've got this in the jQuery category, here's a JQ way of approaching it. The unknown bit is what the mouseover is doing... it might be triggering some kind of async event before it writes to the page. I have put in a little delay after mouseover which you might need to edit
$("._23fpc").each(function () {
$(this).trigger('mouseenter');
doMO($(this));
})
function doMO($el) {
setTimeout(() => {
$el.trigger('click');
}, 100)
}