diff --git a/workers/commandor_page.py b/workers/commandor_page.py index b90a6ec..1d92735 100644 --- a/workers/commandor_page.py +++ b/workers/commandor_page.py @@ -7,6 +7,7 @@ import threading import time from typing import Union +from gsmmodem import GsmModem from playwright.sync_api import sync_playwright import params @@ -217,6 +218,7 @@ class CommandorPage: def _setPhoneCountryAndStore(self): # document.getElementById("prefer").value = \"faubourg\"; self.page.evaluate("""()=>{ + document.getElementById("prefer").value = \"faubourg\"; document.getElementById("phone_country").focus(); document.getElementById("phone_country").value = \"FR\" }""") @@ -310,7 +312,7 @@ def on_success(result: ReserveResultPojo): pass -def launch_page(ready_for_otp) -> threading.Event: +def launch_page() : PROXY_USERNAME = "panleicim-res-fr-" + get_random_id_number_for_proxy() print("proxy_username is " + PROXY_USERNAME) proxy = { @@ -323,8 +325,12 @@ def launch_page(ready_for_otp) -> threading.Event: contact = ContactPojo(phone_number="+33758912245", passport_number=passport_number, last_name="XU", first_name="xingzhen", mail="ColbyPatel653@gmail.com", ccid="", position=0) - page = CommandorPage() - return page.start_page(proxy) + modem = GsmModem("/dev/tty.usbmodem1422307") + serial_modem = SerialModem(modem) + serial_modem.contact = contact + serial_modem.phone_number = contact.phone + page = CommandorPage(serial_modem, 1,1) + return page.start_page(None) def wait_for_otp(event: threading.Event, commandor: CommandorPage): @@ -335,7 +341,7 @@ def wait_for_otp(event: threading.Event, commandor: CommandorPage): if __name__ == '__main__': - event = launch_page(wait_for_otp) + launch_page() # time = get_random_wait_time() # print(time) # import urllib.request