@valexe-technologies/lookup.services
Version:
Business Services for Lookup
56 lines • 2.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BigRockDomainRegistrar = void 0;
const _1 = require(".");
class BigRockDomainRegistrar extends _1.BaseDomainRegistrar {
constructor() {
super(...arguments);
this.properties = {
name: 'BigRock',
baseUrl: 'https://www.bigrock.in',
currencyCodes: [
"INR",
"USD"
],
features: [
'Basic DNS',
'2 Email Accounts',
'Domain Forwarding',
'URL Masking',
'DNS Management',
'Domain Theft Protection'
]
};
}
async getDomainPrice(browser, domainNameWithTLD, currency) {
let page = await browser.newPage();
let url = `${this.properties.baseUrl}/domain-registration/index.php`;
await this.setupUserAgent(page);
await page.goto(url, {
waitUntil: 'networkidle2'
});
await this.changeCurrency(page, currency);
await page.waitForSelector('div#section1 > div > input[name=txtDomainName]');
await page.type('div#section1 > div > input[name=txtDomainName]', domainNameWithTLD);
await page.keyboard.press('Enter');
await page.waitForNavigation();
let innerHtml = await this.waitForSelectorAndGetInnerHtml(page, '#primarySearch > div:nth-child(3) > div > span.pricing-wrp > strong');
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)
};
}
async changeCurrency(page, currency) {
if ('INR' == currency) {
return;
}
await page.select('#country_dropdown', 'US');
}
}
exports.BigRockDomainRegistrar = BigRockDomainRegistrar;
//# sourceMappingURL=bigRockDomainRegistrar.js.map