jeudi 19 novembre 2020

Trigger new python script when class name is met and then return when script is done

I am trying to figure out to have my first script go to a second script but only when the first script experiences a new web page with specific text on it at some point.

I am using selenium and webdriver.

file 1 (file where trigger event happens)

from creroute import test

   if True:
        #try:
            content = driver.find_element_by_class_name('message')
            #driver.find_element_by_class_name("message")
            test()

file 2 (new script to run)

def test():       
    driver.get("https://www.facebook.com")

Aucun commentaire:

Enregistrer un commentaire