Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with pop-up
#1
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!
Reply
#2
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
Thanks! I should have thought about that. I'll take a peek at those.
Reply
#4
@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.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020