Using posting key to log in instead of keychain works well for getting around this. Using XPATH is probably more reliable than the div, too :)
I could dig up my old code for this, but I withdrew from liq pools quite some time ago, so my focus is just like yours, building that sweet, sweet, sps stake