Re:Computational survivalist
by Thiez on Thursday October 10, 2019 @08:52AM
(#21213821)
In that particular situation I imagine that a smart line of Javascript in the developer console would also have worked. Without the email file (so you must copy the result from the dev console), but it is considerably easier than using curl or wget when the page is behind a login page.
[ Parent
| on HN ]
I came up with:
document.documentElement.innerHTML.split('\n').forEach( (line) => line.includes('mailto:') ? console.log(line) : 0 )
But please push this further (is there a shorter way to say document.documentElement.innerHTML ?)
Not minimized but generates a file 'emails.txt':
a = document.createElement('a');
a.download = 'emails.txt';
a.href = `data:text/plain,${Array.from(document.querySelectorAll('a')).map(a => a.href).filter(s => ~s.indexOf('mailto')).join(',')}`;
document.body.appendChild(a);
a.click();
Re:Computational survivalist
by sushisource on Thursday October 10, 2019 @04:25PM
(#21218796)
That's a really cool trick for creating a file you can download.
something like this:
`document.getElementsByTagName('a').map(elem => elem.href)`
this works at least in chrome console (to get link urls, not emails)
[...($$('a'))].map(e => e.href)
we shared files on a mounted NAS. getting him the CSV was just a "cp"
can you share the smart line of javascript? You have 60 seconds, go.
Parent mentioned it was behind a login page - in which case using wget becomes more of a hassle.