$echo '{
< "startUrls": [
< {
< "url": "https://www.amazon.com"
< }
< ],
< "actions": [
< {
< "type": "humanActivity"
< },
< {
< "type": "screenshot",
< "key": "amazon-home"
< },
< {
< "type": "type",
< "selector": "#twotabsearchtextbox",
< "value": "mechanical keyboard"
< },
< {
< "type": "click",
< "selector": "#nav-search-submit-button"
< },
< {
< "type": "wait",
< "time": 3000
< },
< {
< "type": "screenshot",
< "key": "amazon-search"
< },
< {
< "type": "humanActivity"
< },
< {
< "type": "scroll",
< "pages": 2
< },
< {
< "type": "screenshot",
< "fullPage": true,
< "key": "amazon-results"
< },
< {
< "type": "javascript",
< "expression": "(() => { const items = [...document.querySelectorAll('\''[data-component-type=\\"s-search-result\\"]'\'')].slice(0, 5).map((el, i) => ({ rank: i+1, title: el.querySelector('\''h2'\'')?.textContent?.trim(), price: el.querySelector('\''.a-price .a-offscreen'\'')?.textContent, rating: el.querySelector('\''.a-icon-alt'\'')?.textContent, url: el.querySelector('\''h2 a'\'')?.href })); return JSON.stringify(items); })()"
< },
< {
< "type": "extractContent",
< "format": "text"
< }
< ]
<}' |
<apify call nocturne/stealth-website-crawler --silent --output-dataset