选择总店 # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch master # Your branch is up to date with 'origin/master'. # # Changes

to be committed: # modified:  workers/commandor_page.py # # Changes not staged for commit: # modified:  logs/LogSender.py #
This commit is contained in:
2022-04-21 23:17:05 +02:00
parent b526192be0
commit d72a1ec631
+10 -4
View File
@@ -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