コード例 #1
0
    def _generate_ssn(self):
        print("Generating SSN....")
        baseURL = 'https://www.ssn-verify.com/generate'

        state_control_ID = 'state'
        year_control_ID = 'year'
        btn_submit_ID = 'ssn-submit'
        result_ssn_CLASS_NAME = 'result-ssn'

        new_tab(self.driver, baseURL)
        switch_to(self.driver, 'generate')

        self.set_select(state_control_ID, "california")

        self.set_select(year_control_ID, "1997")

        self._click_button_by_ID(btn_submit_ID)

        time.sleep(3)

        ssn_number = WebDriverWait(self.driver, 30).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, result_ssn_CLASS_NAME))).text

        self._ssn = ssn_number
コード例 #2
0
    def _generate_phone_number(self):
        print("Generating phone numbers....")

        baseURL = 'https://www.fakephonenumber.org/UnitedStates/phone_number_generator?state=CA'

        new_tab(self.driver, baseURL)
        switch_to(self.driver, 'fakephonenumber')

        self._phone_num = WebDriverWait(self.driver, 30).until(
            EC.presence_of_element_located(
                (By.XPATH, '/html/body/div[1]/div/div[2]/div[3]/div/ul[1]/li[1]/p[1]/a'))).text
        self._parent_phone_num = WebDriverWait(self.driver, 30).until(
            EC.presence_of_element_located(
                (By.XPATH, '/html/body/div[1]/div/div[2]/div[3]/div/ul[1]/li[2]/p[1]/a'))).text