add mobile proxy
This commit is contained in:
@@ -61,7 +61,6 @@ class ResultChecker:
|
||||
def run(self, reserve_pojo: ReserveResultPojo, collection):
|
||||
print("Launched worker in ", threading.current_thread().name)
|
||||
url = reserve_pojo.url
|
||||
phone_number = reserve_pojo.phone
|
||||
# url_to_check = url.replace("register/", "")
|
||||
# url_to_check = url + "?lang=fr"
|
||||
print("url is " + url)
|
||||
|
||||
@@ -15,7 +15,9 @@ PROXY_PASSWORD = "94sY7zwBG13i"
|
||||
|
||||
BRIGHT_DATA_PROXY_SERVER = "http://zproxy.lum-superproxy.io:22225"
|
||||
BRIGHT_DATA_PROXY_USERNAME = "lum-customer-c_daabba94-zone-residential-country-fr"
|
||||
BRIGHT_DATA_MOBILE_PROXY_USERNAME = "lum-customer-c_daabba94-zone-mobile-country-fr-city-paris-mobile"
|
||||
BRIGHT_DATA_PROXY_PASSWORD = "9dwmh54u3bbh"
|
||||
BRIGHT_DATA_MOBILE_PROXY_PASSWORD = "fk5f7c2z2c19"
|
||||
PROXY_NAME_PREFIX_RES = "panleicim-res-fr-"
|
||||
PROXY_NAME_PREFIX_CC = "panleicim-cc-fr-"
|
||||
|
||||
@@ -37,10 +39,15 @@ def get_proxy(proxy_type=0):
|
||||
"password": PROXY_PASSWORD
|
||||
}
|
||||
else:
|
||||
# proxy = {
|
||||
# "server": BRIGHT_DATA_PROXY_SERVER,
|
||||
# "username": BRIGHT_DATA_PROXY_USERNAME,
|
||||
# "password": BRIGHT_DATA_PROXY_PASSWORD
|
||||
# }
|
||||
proxy = {
|
||||
"server": BRIGHT_DATA_PROXY_SERVER,
|
||||
"username": BRIGHT_DATA_PROXY_USERNAME,
|
||||
"password": BRIGHT_DATA_PROXY_PASSWORD
|
||||
"username": BRIGHT_DATA_MOBILE_PROXY_USERNAME,
|
||||
"password": BRIGHT_DATA_MOBILE_PROXY_PASSWORD
|
||||
}
|
||||
return proxy
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ class CommandorPage:
|
||||
proxy = params.get_proxy(self.proxy_type)
|
||||
# wait for sms_code field
|
||||
# self.clickOnValidBtn()
|
||||
time.sleep(4000)
|
||||
self.thread_event = e
|
||||
otp_input = self.page.locator(OTP_FIELD_ID)
|
||||
otp_input.wait_for(state='visible', timeout=TIME_OUT)
|
||||
@@ -374,17 +375,12 @@ def on_success(result: ReserveResultPojo):
|
||||
|
||||
|
||||
def launch_page():
|
||||
proxy = {
|
||||
"server": params.BRIGHT_DATA_PROXY_SERVER,
|
||||
"username": params.BRIGHT_DATA_PROXY_USERNAME,
|
||||
"password": params.BRIGHT_DATA_PROXY_PASSWORD
|
||||
}
|
||||
passport_number = get_random_id_number()
|
||||
contact = ContactPojo(phone_number="+33758912245", passport_number=passport_number, last_name="XU",
|
||||
first_name="xingzhen",
|
||||
mail="ColbyPatel653@gmail.com", ccid="", position=0)
|
||||
page = CommandorPage(contact, store_type=1)
|
||||
return page.start_page(proxy)
|
||||
return page.start_page(params.get_proxy(0))
|
||||
|
||||
|
||||
def wait_for_otp(event: threading.Event, commandor: CommandorPage):
|
||||
|
||||
Reference in New Issue
Block a user