do not duplicate contacts
This commit is contained in:
@@ -182,7 +182,7 @@ class CommandorPage {
|
||||
if (!page.isClosed()) {
|
||||
if (!this.isPhoneInput) {
|
||||
await page.locator(PHONE_NUMBER).focus();
|
||||
await page.locator(PHONE_NUMBER).fill("0" + this.contact.phoneNumber);
|
||||
await page.locator(PHONE_NUMBER).fill("+330" + this.contact.phoneNumber);
|
||||
this.isPhoneInput = true;
|
||||
}
|
||||
}
|
||||
@@ -391,17 +391,10 @@ class CommandorPage {
|
||||
//try to sliding capthca at first
|
||||
let slidingCaptchaSolver = new SlidingCaptchaSolver(this.device);
|
||||
await slidingCaptchaSolver.solve(this.page, async (isSuccessful) => {
|
||||
console.log("check isAlwaysBlocked")
|
||||
let isAlwaysBlocked = await this.isBlocked();
|
||||
if (isAlwaysBlocked) {
|
||||
let audioBtn = await this.page.frameLocator("iframe").locator("#captcha__audio__button");
|
||||
log("audioBtn found")
|
||||
audioBtn.click()
|
||||
let captchaSolver = new GeoCaptchaSolver(this.page, this.device, this.isTerminated)
|
||||
await captchaSolver.solve((isSuccessful) => {
|
||||
if (!isSuccessful) {
|
||||
this.isTerminated = true
|
||||
}
|
||||
})
|
||||
await this.resolveByAudio();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -412,6 +405,18 @@ class CommandorPage {
|
||||
}
|
||||
}
|
||||
|
||||
async resolveByAudio() {
|
||||
let audioBtn = await this.page.frameLocator("iframe").locator("#captcha__audio__button");
|
||||
log("audioBtn found")
|
||||
audioBtn.click()
|
||||
let captchaSolver = new GeoCaptchaSolver(this.page, this.device, this.isTerminated)
|
||||
await captchaSolver.solve((isSuccessful) => {
|
||||
if (!isSuccessful) {
|
||||
this.isTerminated = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async onResponse(response) {
|
||||
// let rex = new RegExp(REGEX_RDV_URL)
|
||||
// log("onResponse with url:" + response.url())
|
||||
|
||||
Reference in New Issue
Block a user