CA
Crawlee & Apify•3y ago
stormy-gold

Web Scraper

From the console I can get the text I want $('span.val').get(0).textContext; However when I try the following Apify doesn't seem toe like the get WARN PuppeteerCrawler: Reclaiming failed request back to the list or queue. $(...).get(...).text is not a function Any pointers to get me past this point are most welcome async function pageFunction(context) { // This statement works as a breakpoint when you're trying to debug your code. Works only with Run mode: DEVELOPMENT! // debugger; // jQuery is handy for finding DOM elements and extracting data from them. // To use it, make sure to enable the "Inject jQuery" option. const $ = context.jQuery; const pageTitle = $('title').first().text(); const length = $('span.val').get(0).text();
7 Replies
optimistic-gold
optimistic-gold•3y ago
Perhaps $('span.val').get(0) return nothing/undefined
HonzaS
HonzaS•3y ago
Would help if you share what you want to get from what page.
stormy-gold
stormy-goldOP•3y ago
I seem unable to append to my original message Seems very dumb...
stormy-gold
stormy-goldOP•3y ago
Sun Odyssey 349 | Jeanneau Boats
An enormous success in the Sun Odyssey line, this sailboat is responsive at the helm and easy to handle, for experienced sailors and motivated beginners,...
MEE6
MEE6•3y ago
@Deleted User just advanced to level 1! Thanks for your contributions! 🎉
HonzaS
HonzaS•3y ago
and get(0) should return first element? it does not work for me on the page, normal syntax is $('span.val').eq(0).text()
stormy-gold
stormy-goldOP•3y ago
OK Let me check that Thanks for the reply That worked Great thanks Honza

Did you find this page helpful?