0

I'm trying to connect to a website (for example this facebook group) and execute two functions every 5 minutes:

  1. window.scrollBy(0, 6000)

  2. on 7 top posts:

    let event = new FocusEvent('focusin', {
       'view': window,
       'bubbles': true,
       'cancelable': true
    });
    post.dispatchEvent(event);
    
  3. Get the webpage content

Ofcourse the first thing that comes in mind is selenium, but the problem is that selenium is very heavy on my pc and I'm running this script on a very old pc that it takes too much time to execute.
I was wondering if I can perform that without the need of automating an actual browser, maybe using a library like requests or websockets to connect to the website and pass some javascript to it (I was able to perform the third point easily with requests.get(url).content but the first 2 is the problem)

user2401856
  • 468
  • 4
  • 8
  • 22

0 Answers0