JJJJJJJJJJJ
Member
Hey Guys,
I’m really missing the HTTP module that Make offers, so figured that with a little help of LLMs I could easily build this with the Code action in Pabbly.
Guess not.
Has anyone achieved this, or is it impossible?
This is what I came up with
I’m really missing the HTTP module that Make offers, so figured that with a little help of LLMs I could easily build this with the Code action in Pabbly.
Guess not.
Has anyone achieved this, or is it impossible?
This is what I came up with
JavaScript:
async function fetchHTMLContent(url) {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`Failed to fetch: ${response.status} ${response.statusText}`);
}
const htmlContent = await response.text();
return htmlContent;
} catch (error) {
console.error('Error:', error);
return 'Error';
}
}
// Example usage:
const url = 'https://example.com'; // Replace with the URL of the webpage you want to fetch
fetchHTMLContent(url)
.then(htmlContent => {
if (htmlContent && htmlContent !== 'Error') {
console.log('HTML content:', htmlContent);
} else {
console.log('Failed to fetch HTML content.');
}
});