Python Forum
Microsoft text phone verifying account
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Microsoft text phone verifying account
#3
(Jul-21-2022, 11:35 AM)Larz60+ Wrote: you didn't explain which package you are using I will assume selenium for this response:

instead of using sleep for a specified amount of time, use WebDriverWait and wait until presense of
something which changes after your submission.

Advantage is that the delay will only last as long as necessary, so you can make it larger.
If you do this, the longer delay will only occur if necessary

In the following example (see: https://selenium-python.readthedocs.io/waits.html ):

'delay' variable was set during class initialization to 30, usually only uses less than one second, and as mentioned the selenium driver will only use the necessary time, then continue

i am expecting the text to show up in element see 'Expected Conditions' on above webpage.
see: ( https://selenium-python.readthedocs.io/a...nt_located

i wait for an element using CSS_SELECTOR there are several choices.

Here it's waiting for display of page number text: 'Page 1 of 1, records 1 to 1 of 1' or similar.
Rarely fails.

Example:
    element = WebDriverWait(self.browser, delay).until( \
        EC.presence_of_element_located((By.CSS_SELECTOR, '#txtCommonPageNo')))

Yes, you are correct, I am using selenium
import logging
import smtplib
import time
from datetime import datetime
from email.message import EmailMessage
from os import environ, path

from msedge.selenium_tools import Edge, EdgeOptions
from selenium.webdriver.common.keys import Keys

# Constants
WEBDRIVER_PATH = "C:\\Tools\\msedgedriver.exe" 
# Get our email and password from Enviroment Variables
So, if I apply your solution from above I will resolve my problem with text message account verification since Edge every time (after closing it) asks me for text message verification.

Attached Files

Thumbnail(s)
   
Reply


Messages In This Thread
Microsoft text phone verifying account - by cito - Jul-21-2022, 09:07 AM
RE: Microsoft text phone verifying account - by cito - Jul-21-2022, 12:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error : "Microsoft Visual C++ 14.0 is required. " Even its installed Barak 4 4,153 Oct-13-2021, 10:39 PM
Last Post: Underscore
  Send SMS from my phone number aster 3 2,823 Jul-03-2021, 02:34 PM
Last Post: ndc85430
  Creating Excel files compatible with microsoft access vkallavi 0 1,631 Sep-17-2020, 06:57 PM
Last Post: vkallavi
  lists Name Address Phone Heyjoe 2 1,847 Jun-21-2020, 10:47 AM
Last Post: Heyjoe
  Authentication error when accessing Microsoft SharePoint klllmmm 3 10,638 Jun-10-2020, 07:46 AM
Last Post: nuffink
  Access phone via Bluetooth maxwell 2 2,371 Jun-03-2020, 05:22 PM
Last Post: maxwell
  Phone numbers ovidius80 2 2,133 Mar-12-2020, 07:08 PM
Last Post: Larz60+
  Different results of code with local account and technical account dreyz64 7 3,798 Mar-05-2020, 11:50 AM
Last Post: dreyz64
  Trying to install Pyquil, says I need Microsoft Visual C++ Groucho 10 5,162 Feb-18-2020, 05:46 PM
Last Post: snippsat
  2 Microsoft word Docx content comparison vintysaw 2 5,934 Oct-17-2019, 10:41 AM
Last Post: vintysaw

Forum Jump:

User Panel Messages

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