pythonautomationbreakautowebbot

Why do i keep getting break error? I have the same problem with continue and pass


from webbot import Browser
import time
import pyautogui
from pyautogui import *
web = Browser()
a == True
web.go_to('http://au.yahoo.com//')
web.scrolly(100)
if a == True:
    try:
        web.click('Skip for now')
        break
web.click('Mail')
time.sleep(10)
pyautogui.keyDown('ctrl')

break keeps coming up with unexpected error

I want it to try click 'skip for now', if not then continue the code


Solution

  • try:
        web.click("Skip for now")
    except:
        pass