3👍
If you want to improve the code readability, you should see to follow a page object pattern.
A first step would be to define the locator in a variable with an explicit name:
from selenium.webdriver.common.by import By
item_wine_pinot_noir = (By.XPATH, "//a/h4[text()='%s']" % "Pinneau noir")
browser.find_element(*item_wine_pinot_noir).click()
- [Django]-How to set Celery with TTL so it purges old messages from a queue?
- [Django]-What's gettext_lazy on django is for?
- [Django]-Django google maps
- [Django]-Evaluate a readonly field upon creating a new object in Django 1.11 admin
- [Django]-Django/DRF app receives AttributeError: 'function' object has no attribute 'get_extra_actions'
Source:stackexchange.com