@valexe-technologies/lookup.services
Version:
Business Services for Lookup
42 lines • 1.55 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TwoGBHostingDomainRegistrar = void 0;
const _1 = require(".");
class TwoGBHostingDomainRegistrar extends _1.BaseDomainRegistrar {
constructor() {
super(...arguments);
this.properties = {
name: '2GB Hosting',
baseUrl: 'https://manage.2gbhosting.com',
currencyCodes: [
"INR"
],
features: [
'Basic DNS'
]
};
}
async getDomainPrice(browser, domainNameWithTLD, _) {
let page = await browser.newPage();
let url = `${this.properties.baseUrl}/domainprice.php`;
let tld = this.extractTLD(domainNameWithTLD);
await this.setupUserAgent(page);
await page.goto(url, {
waitUntil: 'networkidle2'
});
await page.waitForSelector('form > div > div > input');
await page.type('form > div > div > input', tld);
let innerHtml = await this.waitForSelectorAndGetInnerHtml(page, 'table > tbody:nth-child(2) > tr > td:nth-child(2)');
await page.close();
if (null == innerHtml) {
console.warn(`Failed to get Element for ${this.properties.name} Price`);
return null;
}
return {
url: this.properties.baseUrl,
price: this.extractPrice(innerHtml)
};
}
}
exports.TwoGBHostingDomainRegistrar = TwoGBHostingDomainRegistrar;
//# sourceMappingURL=twoGBHostingDomainRegistrar.js.map