Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Avoid the Gates of Hell. Use Linux -- unknown source


devel / comp.lang.javascript / How to implement If condition

SubjectAuthor
o How to implement If conditionSwetha Gorantla

1
How to implement If condition

<3a380774-b002-4cb0-ba33-19bb231b8af1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17239&group=comp.lang.javascript#17239

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a37:741:: with SMTP id 62mr32163004qkh.490.1629889315104;
Wed, 25 Aug 2021 04:01:55 -0700 (PDT)
X-Received: by 2002:a05:6808:a82:: with SMTP id q2mr6248665oij.100.1629889314759;
Wed, 25 Aug 2021 04:01:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Wed, 25 Aug 2021 04:01:54 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=49.37.178.233; posting-account=61QqzwoAAADN2-u-PchIIXcSG3Ccl8US
NNTP-Posting-Host: 49.37.178.233
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3a380774-b002-4cb0-ba33-19bb231b8af1n@googlegroups.com>
Subject: How to implement If condition
From: swethagorantla17@gmail.com (Swetha Gorantla)
Injection-Date: Wed, 25 Aug 2021 11:01:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Swetha Gorantla - Wed, 25 Aug 2021 11:01 UTC

Hi,
Can someone please help me to resolve this issue?
I have the following code

async function reserved_slot(page, target_url) {
var fifthwkslotdate= new Date();
fifthwkslotdate.setDate(fifthwkslotdate.getDate() + 7);
await page.goto(`${target_url}en-GB/slots/delivery/${fifthwkslotdate}?slotGroup=1`, {waitUntil: 'networkidle2'});
await page.waitForTimeout(3000);
await page.screenshot({path: 'HomeDeliveryFifthwkPage.png'});
await page.click('[class="button button-secondary small available-slot--button available-slot--button--cc-link-enabled"]');
await page.waitForTimeout(3000);
await page.screenshot({ path: 'Reservedelslotpage.png'});
}

By using this code i am reserving the slot. But if slot is not avialable in the page i have to go to another page to book the slot.
1) await page.goto(`${target_url}en-GB/slots/delivery/${fifthwkslotdate}?slotGroup=1`, {waitUntil: 'networkidle2'}); after going to this page i can come to know whether slot is there or not by seeing this message "Delivery slots for these dates are fully booked". How to capture this value from the above page response.
2) If slot is available i can book the slot using "await page.click('[class="button button-secondary small available-slot--button available-slot--button--cc-link-enabled"]');" other wise i have to go other page by using "fifthwkslotdate.setDate(fifthwkslotdate.getDate() + 0);". How to implement this condition.

Thanks in advance.


devel / comp.lang.javascript / How to implement If condition

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor