选择总店 # 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:
@@ -7,6 +7,7 @@ import threading
|
|||||||
import time
|
import time
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
|
from gsmmodem import GsmModem
|
||||||
from playwright.sync_api import sync_playwright
|
from playwright.sync_api import sync_playwright
|
||||||
|
|
||||||
import params
|
import params
|
||||||
@@ -217,6 +218,7 @@ class CommandorPage:
|
|||||||
def _setPhoneCountryAndStore(self):
|
def _setPhoneCountryAndStore(self):
|
||||||
# document.getElementById("prefer").value = \"faubourg\";
|
# document.getElementById("prefer").value = \"faubourg\";
|
||||||
self.page.evaluate("""()=>{
|
self.page.evaluate("""()=>{
|
||||||
|
document.getElementById("prefer").value = \"faubourg\";
|
||||||
document.getElementById("phone_country").focus();
|
document.getElementById("phone_country").focus();
|
||||||
document.getElementById("phone_country").value = \"FR\" }""")
|
document.getElementById("phone_country").value = \"FR\" }""")
|
||||||
|
|
||||||
@@ -310,7 +312,7 @@ def on_success(result: ReserveResultPojo):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def launch_page(ready_for_otp) -> threading.Event:
|
def launch_page() :
|
||||||
PROXY_USERNAME = "panleicim-res-fr-" + get_random_id_number_for_proxy()
|
PROXY_USERNAME = "panleicim-res-fr-" + get_random_id_number_for_proxy()
|
||||||
print("proxy_username is " + PROXY_USERNAME)
|
print("proxy_username is " + PROXY_USERNAME)
|
||||||
proxy = {
|
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",
|
contact = ContactPojo(phone_number="+33758912245", passport_number=passport_number, last_name="XU",
|
||||||
first_name="xingzhen",
|
first_name="xingzhen",
|
||||||
mail="ColbyPatel653@gmail.com", ccid="", position=0)
|
mail="ColbyPatel653@gmail.com", ccid="", position=0)
|
||||||
page = CommandorPage()
|
modem = GsmModem("/dev/tty.usbmodem1422307")
|
||||||
return page.start_page(proxy)
|
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):
|
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__':
|
if __name__ == '__main__':
|
||||||
event = launch_page(wait_for_otp)
|
launch_page()
|
||||||
# time = get_random_wait_time()
|
# time = get_random_wait_time()
|
||||||
# print(time)
|
# print(time)
|
||||||
# import urllib.request
|
# import urllib.request
|
||||||
|
|||||||
Reference in New Issue
Block a user