Created
August 18, 2018 23:22
-
-
Save geshan/378be819646682c715e38a653c680401 to your computer and use it in GitHub Desktop.
domain-shortlist-to-ids
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| urls = $$('a.listing-result__address'); | |
| links = []; | |
| ids = []; | |
| for (url in urls) { | |
| links.push(urls[url].href.split('-')); | |
| } | |
| for(linkArr of links) { | |
| ids.push(linkArr[linkArr.length - 1]); | |
| } | |
| console.log(ids.join()); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
urls = $$('a');
links = [];
for (url in urls) {
const href =urls[url].href;
console.log(href);
if (href.startsWith('https://react.dev/learn')) {
links.push(href);
}
}
console.log(links)