Open frankcollins3 opened 1 year ago
puppeteer: (GraphQL RootQueryType key)
{message: 'Navigation timeout of 30000 ms exceeded',
this looks to be the error blocking the running of code.
[1:31pm]
proposed approach:
separate concerns and step away from the
I made a local file to separate concerns of puppeteer running a javascript console (like w3schools') that has quirks that make it hard to target by conventional id or class targeting.
while I don't have a console implemented, we can facilitate the alert without the console, by interacting with DOM
[2:49pm]
what is happening is: file:///Users/medium/Desktop/alert.html
<body>
<div id="writing-board">
</div>
<script src="" async defer></script>
</body>
</html>
file:///Users/medium/Desktop/pokemonGO/client/src/components/element/RealScreen.js
1) has string data appended through a clientside invocation of fetch() which accesses a GraphQL endpoint @:
file:///Users/medium/Desktop/pokemonGO/server/index.js this endpoint houses a resolve function and this block of code: page.evaluate() => function through which DOM elements may be targeted, and mutated/manipulated. In this example document.querySelector('#writing-board') is reaching into that Desktop/alert.html file and writing to let promises = [
puppeteer.launch({headless: false}).then(async(browser) => {
let promises = [
puppeteer.launch({headless: false}).then(async (browser) => {
const page = await browser.newPage();
await page.goto('file:///Users/medium/Desktop/alert.html');
// Write HTML code to the #writing-board element
**await page.evaluate(() => {
const writingBoard = document.querySelector('#writing-board');
writingBoard.innerHTML = '<h1>Here is my alert</h1>';
});**
// await browser.close();
})
];
await Promise.all(promises);
})
take this code here:
the invocation of alert('hey') is supposedly the code that could bypass the need for a C/python prompt. C isn't built with browser in mind so doesn't have those properties/methods built in. With puppeteer, I realized if we could take input on whatever text would go into the alert() method:
We could essentially built a very basic Pomodoro-Session app that would receive user-specified input on: 1) how long the session will be 2) any key concepts or learnings worth storing to a db or other method of saving data. storing data could be facilitated:
first proposed approach: find the id or class of [run] to target with .click()
found the button:
[12:53pm]