I'm trying to connect to a website (for example this facebook group) and execute two functions every 5 minutes:
window.scrollBy(0, 6000)
on 7 top posts:
let event = new FocusEvent('focusin', { 'view': window, 'bubbles': true, 'cancelable': true }); post.dispatchEvent(event);
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)