new method to extract names

This commit is contained in:
2023-05-11 00:23:51 +02:00
parent 2ba53ea677
commit 2e45143c61
5 changed files with 131 additions and 66 deletions
+2 -5
View File
@@ -24,10 +24,9 @@ DOUBLE_REQUEST_ERROR_MESSAGE_FR = "Une demande avec les données saisies a déj
class LinkValidator:
tls = TlsPlaywright()
def __init__(self, link: str, proxy_type=ProxyType.RESIDENTIAL, headless=False):
def __init__(self, link: str, headless=False):
self.is_finished = False
self.link = link
self.proxy_type = proxy_type
self.is_event_sent = False
self.is_captcha_in_error = False
self.is_filling_fields = False
@@ -50,10 +49,8 @@ class LinkValidator:
def _run(self, proxy):
self.logger.info("will start browser")
# reset otp_value to None
devices = random.choice(params.DEVICES)
first_page = None
# while first_page is None:
self.start_browser(proxy, self.tls.playwright, devices)
self.start_browser(self.tls.playwright)
# proxy = params.get_proxy(self.proxy_type)
otp_input = self.page.locator(OTP_FIELD_ID)
otp_input.wait_for(state='visible', timeout=TIME_OUT)