How to make selenium in python faster
Just a short review from me:
The artificial delays (time.sleep(0.5)) are superfluous and not safe. They slow you down sometimes, they fail sometimes, because the pages take longer than usual to load.
Instead you can use Selenium selector functions, to wait until an element appears (or disappears). For example, you could have something like this:
element = WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.XPATH, &quot;//button[text()=&quot;Dodaj u korpu&quot;]&quot;)))
)

Here, we wait for an element to be in clickable state, but set a timeout of 10 seconds for the condition to be realized. You have a solid range of similar options available. Check out the doc: Waits
Likewise, you can get rid of the exception handling block (NoSuchElementException). My advice is to replace the sleeps with adequate wait functions, depending on the conditions you want to test. This should make your code more reliable and probably a bit faster, because it's not going to wait for longer than necessary.
Since your concern is speed: I would say 4.90 seconds is not bad but I don't know your constraints. Have you benchmarked your code to find out what is taking time ? Use the timeit module or - recommended link: Python Timer Functions: Three Ways to Monitor Your Code to set up your own timing class.
From experience, Selenium takes time to load, so perhaps you might as well leave it running in the background and use a loop to refresh the page at regular intervals, while being gentle and taking care not to overload the site.