0
Hello. I have this code:
import os
from selenium import webdriver
import time
def visita(link):
try:
options = webdriver.ChromeOptions()
options.add_argument('--headless')
driver = webdriver.Chrome(options=options)
driver.get(link)
driver.execute_script('window.scrollTo(0,document.body.scrollHeight);')
time.sleep(5)
except Exception as e:
print(e)
driver.close()
links = ['https://link.com/post/6074/','https://link.com/post/6288/']
while True:
for link in links:
visita(link)
Code summary:
1- Open links using chromedriver
2- Run a javascript on the page to scroll to the bottom of the page, wait 5 seconds and close with driver.close()
Problem: Code execution is quite slow.
Is there any other module/library that can do the same more effectively ?
Try to improve the question, something like: how can I let my interface test run faster?
– Roberto Leite de Moraes