What we are most subtle in
thoughts on ai alignment
- tags
Lightpanda is purpose-built for AI and automation workflows. If you want to pull down some data from a website and have it parse Javascript and all that, this is a fast and lightweight tool that makes it happen.
|
|
Pull down a page:
|
|
Install htmlq
if you don't have it
|
|
test.html
:
|
|
setup a simple server:
|
|
Then
|
|
<html> <head> <title>This is a dynamic page </title> </head> <body> <div id="content"> <h1> Hi there </h1> <p> This content was dynamically inserted using JavaScript. </p> </div> <script> document.querySelector('#content').innerHTML = `<h1>Hi there</h1> <p>This content was dynamically inserted using JavaScript.</p> ` </script> </body> </html>
So you can see the that the javascript was run.
Add the necessary libraries:
|
|
And then create a script:
|
|
And run it:
|
|
Initial parse returned very little content, trying again title: This is a dynamic page author: content ## Hi there This content was dynamically inserted using JavaScript.
Another example:
|
|
title: Unnecessary Knowledge author: Will Schenk content From Sherlock Holmes: "His ignorance was as remarkable as his knowledge. Of contemporary literature, philosophy and politics he appeared to know next to nothing. Upon my quoting Thomas Carlyle, he inquired in the naivest way who he might be and what he had done. My surprise reached a climax, however, when I found incidentally that he was ignorant of the Copernican Theory and of the composition of the Solar System. That any civilized human being in this nineteenth century should not be aware that the earth travelled round the sun appeared to be to me such an extraordinary fact that I could hardly realize it. “You appear to be astonished,” he said, smiling at my expression of surprise. “Now that I do know it I shall do my best to forget it.” “To forget it!” “You see,” he explained, “I consider that a man’s brain originally is like a little empty attic, and you have to stock it with such furniture as you choose. A fool takes in all the lumber of every sort that he comes across, so that the knowledge which might be useful to him gets crowded out, or at best is jumbled up with a lot of other things so that he has a difficulty in laying his hands upon it. Now the skillful workman is very careful indeed as to what he takes into his brain-attic. He will have nothing but the tools which may help him in doing his work, but of these he has a large assortment, and all in the most perfect order. It is a mistake to think that that little room has elastic walls and can distend to any extent. Depend upon it there comes a time when for every addition of knowledge you forget something that you knew before. It is of the highest importance, therefore, not to have useless facts elbowing out the useful ones.” “But the Solar System!” I protested. “What the deuce is it to me?” he interrupted impatiently; “you say that we go round the sun. If we went round the moon it would not make a pennyworth of difference to me or to my work.” Previously [labnotes](/labnotes) ## Load enviroments the nextjs way ### for scripts tags Next [labnotes](/labnotes) ## Open-WebUI to use ollama ### have a nice little command center tags
From the docs:
Start the server:
|
|
And the cdp.js
:
|
|
Install the library:
|
|
Then run
|
|
[ '//en.wikipedia.org/', '//ja.wikipedia.org/', '//ru.wikipedia.org/', '//de.wikipedia.org/', '//es.wikipedia.org/', '//fr.wikipedia.org/', '//zh.wikipedia.org/', '//it.wikipedia.org/', '//pt.wikipedia.org/',
Previously