I'm trying to scrape the $('a[href^="mailto:"]')
of this website: https://celsius.network/
When I go to the browser console and run that, I get a link so I know it's there.
The issue is that my request (using the Axios library) returns the DOM before javascript is loaded. I've set the User-Agent, but it looks like it's not working.
const axiosClient = () =>
axios.create({
headers: {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4"
},
timeout: 10000
});
axiosClient()
.get("https://celsius.network")
.then(({ data }) => {
console.log("DATAAAAAAAA: ", data);
})
This is returning the original HTML, with the body:
<body>
<div id="app"> </div>
....
instead of the one that's fully loaded after all the javascript has manipulated the DOM.
P.S. I am doing this through firebase functions, so I think there are limits to what I can install.
UPDATE
const findEmail = url =>
new Promise((resolve, reject) => {
// here!
});