Open Chris9a opened 1 year ago
I have had a userStatus error for a week now. Any way to fix it?
Yep I've been testing a change to the xpath for it. It's in the stats.py file, function _get_user_status_json.
I'll post it when I'm at my PC later today.
Update - try this tweak, I've commented out the old version of the line.
def _get_user_status_json(self):
js = self._browser.find_elements(By.XPATH,
'//script[text()[contains(., "userStatus")]]')
if not js:
return {}
matches = re.search(
#r'(?=\{"userStatus":).*(=?\}\};)', js[0].get_attribute('text'))
r'(?=\{"userStatus":).*(=?\};)', js[0].get_attribute('text'))
if not matches:
return {}
return json.loads(matches[0][:-1])
Awesome. Your fix worked, thank you.
I have had a userStatus error for a week now. Any way to fix it?