Skip to content

Instantly share code, notes, and snippets.

@refo
Created October 30, 2016 12:09
Show Gist options
  • Save refo/b68db1994e4bbc4c5d2abb4dc5cb2e63 to your computer and use it in GitHub Desktop.
Save refo/b68db1994e4bbc4c5d2abb4dc5cb2e63 to your computer and use it in GitHub Desktop.
Namecheap scrape domain list and expiration dates
// #maincontent > div > div.dl-wrapper.normal-view > div > div:nth-child(2) > div > table > tbody:nth-child(3) > tr:nth-child(1) > td.domain-name.form > p:nth-child(2) > strong
// #maincontent > div > div.dl-wrapper.normal-view > div > div:nth-child(2) > div > table > tbody:nth-child(3) > tr:nth-child(1) > td.expiring > p > b
var list = $('#maincontent > div > div.dl-wrapper.normal-view > div > div:nth-child(2) > div > table tr.item')
.map(function(idx, item){
return {
'domain': $('td.domain-name.form > p:nth-child(2) > strong', item).text(),
'expiring': $('td.expiring > p > b', item).text()
};
}).toArray();
copy(list);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment