Save account username

This commit is contained in:
Thomas Wade 2020-04-21 16:16:54 +09:30
parent 95b5b25a8e
commit 16312833a4

View File

@ -32,6 +32,9 @@ class FAAPI:
while not self._driver.find_elements_by_id('my-username'): while not self._driver.find_elements_by_id('my-username'):
pass pass
# Save the username of the account we've logged in as
self.username = self._driver.find_elements_by_css_selector('#my-username:not(.hideondesktop)')[0].text.strip()
# Extract the cookies and stop the driver # Extract the cookies and stop the driver
self._cookies = self._driver.get_cookies() self._cookies = self._driver.get_cookies()
self._driver.close() self._driver.close()