Python Forum

Full Version: Help with pop-up
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey all!

First I'd like to start by saying that I am EXTREMELY new to coding so I apologize for my sloppy code.

I am creating a script to log in to Quickbase, search for a location number, find it, open it, parse it, and then dump information into a spreadsheet. I have gotten to logging in and searching for the location ID, but the results come up in a pop-up. I have used Selenium's go_to_alert() function, but this pop-up isn't seen by Selenium. Here is the code. I have removed the pop-up portion as it didn't work, but I was hoping someone has either worked with Quickbase before or knows another way to skin this cat.

centerNumber = input("What center would you like to search for?: ")
    while centerNumber != "no":
        print("Please standby.")
        print("When my pull is complete, I will close FireFox.  Please do not interact with the new FireFox window.")

        browser = webdriver.Firefox()
        browser.maximize_window()
        browser.get('https://regusitpmo.quickbase.com/db/main?a=signin')
        username = browser.find_element_by_css_selector('input.UserInput:nth-child(2)')
        username.send_keys('[email protected]')
        password = browser.find_element_by_css_selector('input.UserInput:nth-child(4)')
        password.send_keys('Password')
        signIn = browser.find_element_by_css_selector('#signin') # Sign in
        signIn.click()
        projectPortal = browser.find_element_by_css_selector('#appIconDiv0 > a:nth-child(1)')
        projectPortal.click()
        time.sleep(5)
        centerNumberField = browser.find_element_by_css_selector('.SearchInput > input:nth-child(1)')
        centerNumberField.click()
        centerNumberField2 = browser.find_element_by_css_selector('.SearchInput > input:nth-child(1)')
        centerNumberField2.send_keys(centerNumber)
        search = browser.find_element_by_css_selector('span.SearchIcon')
        search.click()
        time.sleep(3)
        # alert = browser.switch_to_alert()
        # centerNumberRegEx = re.compile(r"xCentre Number contains '\d\d\d\d': No results")

        print("Would you like to search for another center?")
        newCenterNumber = input("Please enter the center number.  Typing \"no\" will end the program.: ")
        centerNumber = newCenterNumber
I don't see how to attach an image of the pop-up with search results, but I can email said image if need be.

I can store the CSS element for the search results in a variable, but printing the variable does not contain the information I need.

Thanks for all the help!
you can check quick base API
https://help.quickbase.com/api-guide/index.html

there are also python modules to work with it
https://www.google.com/search?q=quickbase+api+python
Thanks! I should have thought about that. I'll take a peek at those.
@buran I did look into these. I dont have access to the db. I have to use and search Quickbase just like a normal user.