I would go with either of the following two choices:
for i in range(2, l + 1):
replace_index = "//form[@id='SubAvailSelectForm']/font/table[2]/tbody/tr[%d]/td[1]/small" % (i,)
job_count_array[replace_index] = sel.get_text(replace_index)
Firstly, you have the same long string used twice, so use replace_index
in its place. This makes the code shorter, and guarantees you don't have any small, hard-to-spot typos differing between the two.
for i in range(2, l + 1):
replace_index = ("//form[@id='SubAvailSelectForm']/"
"font/table[2]/tbody/tr[%d]/td[1]/small") % (i,)
job_count_array[replace_index] = sel.get_text(replace_index)
Second, you can use the "automatic concatenation of strings inside parentheses" trick instead of the end of line escaping for strings. I find it much easier to read this way.
Also worth noting is using (%i,)
instead of %i
for the string formatting. It has proven beneficial in my past to set up a single string formatting argument into a tuple so it is easier to add additional arguments in the future, plus it is nice to be consistent in how string formatting arguments are presented.