Skip to content

Commit

Permalink
Fixed GoDadday css selector
Browse files Browse the repository at this point in the history
  • Loading branch information
indra4you committed Aug 7, 2021
1 parent 6ded3b9 commit 90611ae
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 45 deletions.
80 changes: 40 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
{
"name": "@valexe-technologies/lookup.services",
"version": "1.0.7",
"version": "1.0.8",
"description": "Business Services for Lookup",
"type": "commonjs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"keywords": [
"nodejs",
"typescript",
"puppeteer",
"lookup",
"api",
"domain",
"domain-registrar",
"domain-availability",
"domain-availability-checker",
"domain-price",
"domain-price-checker"
],
"homepage": "https://github.com/ValEXE-Technologies/Lookup.Services",
"publishConfig": {
"access": "public",
Expand Down
6 changes: 3 additions & 3 deletions src/registrars/goDaddyDomainRegistrar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class GoDaddyDomainRegistrar extends BaseDomainRegistrar implements Domai
domainNameWithTLD: string,
currency: string): Promise<DomainPrice> {

const selector = '#exact-match > div > div > div > div > div > div.mb-3 > span.d-inline';
const selector = 'div:nth-child(1) > div > div > div.text-sm-center.mt-1 > span:nth-child(1) > div > span.text-nowrap > span.main-price';
let page = await browser.newPage();
let url = `${this.properties.baseUrl}/domainsearch/find?checkAvail=1&domainToCheck=${domainNameWithTLD}`;

Expand Down Expand Up @@ -58,12 +58,12 @@ export class GoDaddyDomainRegistrar extends BaseDomainRegistrar implements Domai
page: Page,
currency: string
): Promise<void> {
let innerHtml = await page.$eval('div > #currentCurrency', (el) => el.innerHTML);
let innerHtml = await page.$eval('a > #currentCurrency', (el) => el.innerHTML);
if (null == innerHtml) {
return;
}

innerHtml = innerHtml.toUpperCase();
innerHtml = innerHtml.trim().toUpperCase();
currency = currency.toUpperCase();
if (innerHtml.includes(currency)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/registrars/goDaddyWhoIsRegisrar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class GoDaddyWhoIsRegisrar implements WhoIsRegistrar {

try {
await page.waitForSelector(
'#exact-match > div > div > div > div > div > div.mb-3', {
'span[data-cy="availableCard-badge"]', {
timeout: 5000
});
} catch (err) {
Expand Down

0 comments on commit 90611ae

Please sign in to comment.