# komoot's screener.js
```
const checkForText = (url, text) => {
const page = fetch(url);
const body = page.text;
if (body.includes(text)) {
console.log(`Passed. "${text}" found on ${url}`);
} else {
console.error(`Failed. Did not find "${text}" on ${url}!`);
}
}
checkForText('https://www.komoot.com/team', 'Quality');
```
There were a few issues in the code snippet above:
1. Reading a page content needs to be done asynchronously
2. Same story with reading the text
3. As a result, `checkForText()` needs to be an `async` function as well
4. `.text()` is a function and not an attribute and should be called with parantheses
5. `include()` is a fucntion to check if an element exists in an array. In here we better use `.indexOf()` to see if a string object contains a certain string
This is the revised code:
```
const checkForText = async (url, text) => {
const page = await fetch(url);
const body = await page.text();
if (body.indexOf(text) > 0) {
console.log(`Passed. "${text}" found on ${url}`);
} else {
console.error(`Failed. Did not find "${text}" on ${url}!`);
}
}
checkForText('https://www.komoot.com/team', 'Quality');
// Prints out: Passed. "Quality" found on https://www.komoot.com/team
checkForText('https://www.komoot.com/team', 'Potato');
// Prints out: Failed. Did not find "Potato" on https://www.komoot.com/team!
```