src/similarweb.js
/**
 * Search specified domain in similar web
 * @param {object} driver Selenium web driver.
 * @param {string} domain
 * @return {string} domain name in similar web
 */
Search specified domain in similar web
@param {object} driver Selenium web driver.
@param {string} domain
@return {string} domain name in similar web
Search specified domain in similar web @param { object } driver Selenium web driver . @param { string } domain @return { string } domain name in similar web
async function searchDomain(driver, domain) {
  console.log('Searching domain: ' + domain);
  let searchElement = await driver.findElement(By.css('input.universalInput-input'));
  await searchElement.click();
  await searchElement.sendKeys(domain);
  await sleep(500);
  await searchElement.sendKeys(Key.ENTER);
  await driver.wait(until.elementLocated(By.css('div.website-header-title')), waitTime);
  let url = await driver.getCurrentUrl();
  return url.split('/')[6];
}
async function searchDomain ( driver , domain ) { console . log ( 'Searching domain: ' + domain ) ; let searchElement = await driver . findElement ( By . css ( 'input.universalInput-input' ) ) ; await searchElement . click ( ) ; await searchElement . sendKeys ( domain ) ; await sleep ( 500 ) ; await searchElement . sendKeys ( Key . ENTER ) ; await driver . wait ( until . elementLocated ( By . css ( 'div.website-header-title' ) ) , waitTime ) ; let url = await driver . getCurrentUrl ( ) ; return url . split ( '/' ) [ 6 ] ; }
Search specified domain in similar web
 @param {object} driver Selenium web driver.
Search specified domain in similar web @param { object } driver Selenium web driver .