These two piece of code are very very similar
Could it be possible to factorize the code ? With the workflow step, text, and csssel in argument ?