Skip to content

Commit

Permalink
chatgpt login error handled
Browse files Browse the repository at this point in the history
  • Loading branch information
Eviltr0N committed Aug 27, 2024
1 parent c971106 commit 41f2cbc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internshala_bot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,15 @@ def login_internshala(self):

def login_chat_gpt(self):
page = self.browser.new_page()
page.goto('https://chat.openai.com' , timeout=60000, wait_until='networkidle')
try:
page.goto('https://chat.openai.com' , timeout=30000, wait_until='networkidle')
except TimeoutError as e:
print("[red]TimeOut while loading ChatGPT webpage... Trying Again[/]")
try:
page.goto('https://chat.openai.com' , timeout=30000, wait_until='networkidle')
except TimeoutError as e:
print('\n[bold red]Timeout Occured while loading https://chatgpt.com, Please check your network and Try again.\n[/]')
exit()
time.sleep(1)
try:
with page.expect_navigation():
Expand Down

0 comments on commit 41f2cbc

Please sign in to comment.