Skip to content

Commit

Permalink
update stackoverflow login formula
Browse files Browse the repository at this point in the history
Signed-off-by: GuillaumeFalourd <[email protected]>
  • Loading branch information
GuillaumeFalourd committed Apr 5, 2021
1 parent e0c882e commit 3ad9d1a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions stackoverflow/login/src/formula/formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
from webdriver_manager.chrome import ChromeDriverManager

def run(email, password, display_name):
print("Logging into stackoverflow.com")

driver = webdriver.Chrome(ChromeDriverManager().install())
print("🤖 Logging into stackoverflow.com")
options = webdriver.ChromeOptions()
options.add_argument("--headless")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
driver = webdriver.Chrome(ChromeDriverManager().install(), options=options)

try:
driver.get("https://stackoverflow.com")
Expand All @@ -30,7 +33,7 @@ def run(email, password, display_name):
expected_conditions.presence_of_element_located((By.CLASS_NAME, "grid--cell.ws-nowrap.fs-body3"))
)
assert display_name in elem.text
print("✅ Logged into stackoverflow.com and accessed profile page.")
print("\n✅ Logged into stackoverflow.com and accessed profile page.")

except Exception as e:
message = "❌ An error occurred while trying to access stackoverflow.com!"
Expand Down

0 comments on commit 3ad9d1a

Please sign in to comment.