I am trying to automate a purchase procedure. after executing my codes to click on correct prompt buttons to get to card number input page, my code executes the following:
card_num = Image.open('C:\Python\RPA\card_num.png') #find card number input box
find_card_num = pyautogui.locateOnScreen(card_num, confidence = 0.65)
print(find_card_num)
pyautogui.moveTo(find_card_num[0] + (find_card_num[2]/2), find_card_num[1] +
(find_card_num[3]*0.6)) #move the mouse cursor to input box
time.sleep(.5)
pyautogui.click()
time.sleep(.5)
pyautogui.click() #click twice in an interval just in case the first one does not recognise it
time.sleep(5)
str_num = '4789531569875654' #any card number
pyautogui.typewrite(str_num, interval=0.25)' #type card number, I tried .write() as well
my code correctly finds the location of the mouse point and clicks. However, it does not type the card number. I believe the server system rejects or ignores the keyboard input that pyautogui sends, because the input box receives physical keyboard signals. why does it happen and how do I make my code work?
Thank you