In detail:

On the VK site, there is a need to replace the image in poor quality ( #pv_photo img ) with a picture whose address is indicated in "View original" ( pv_more_act_download ), the problem is that until you hover the cursor on the "More" button , the page does not create the pv_more_act_download element. It is necessary that this element was created without unnecessary gestures.

screenshot

The goal, like the problem, is rather stupid, but I have been sitting for half a day already. There were attempts to find a function that works if you hover the cursor, there were attempts to look for ways to automatically move the cursor to this element. But my knowledge in this area is terrible, and my hands are crooked, so it only remains to ask for help here.

  • @ 0xdb, why? And which text do you want to see? There is everything you need in the question. - Qwertiy
  • @Qwertiy in the picture is not the code? Why can't it be added as text? - 0xdb
  • @ 0xdb, no. There is a screenshot of the fact that there is no markup in the markup. The button is marked in red and it is shown that the item is, it is not. And everything you need ( #pv_photo img and pv_more_act_download ) is indicated in the question text. - Qwertiy
  • @Qwertiy Clearly, I will consider. - 0xdb

1 answer 1

 document.querySelector(".pv_actions_more").dispatchEvent(new MouseEvent('mouseenter')) 

Only consider that the element you are interested in appears asynchronously. I.e. just

 document.getElementById('pv_more_act_download') 

the next line after the event does not work.