Questions tagged [cheerio]

Questions about Cheerio, an implementation of core jQuery designed specifically for the server.

Implementation of core jQuery designed specifically for the server. https://github.com/cheeriojs/cheerio

1646 questions
0
votes
0 answers

NodeJS Cheerio cannot read property 'text' of undefined

This is my code. I want to get data from webpages. As you can see, there are two var $ = cheerio.load(html). The problem is on the inner one I got "cannot read property 'text' of undefined" error. What is the solution? request(l1,function(error,…
ZZZ
  • 1,415
  • 5
  • 16
  • 29
0
votes
1 answer

Run an asynchronous call of Cheerios with a Promise

I have a promise call that is supposed to do the following: 1) Get a link from completedLinks 2) Use cheerio to load the html into the $, like jQuery. 3) get the title, and other details from the page 4) save those details to the object…
maudulus
  • 10,627
  • 10
  • 78
  • 117
0
votes
1 answer

Using Cheerio for scraping many sites

I am using cheerio to scrape about 800 websites, to just get the site title. The first issue that I have is that sometimes I am getting an error message saying "We’ve encountered an error: Error: socket hang up". Secondly, maybe because of cheerio's…
maudulus
  • 10,627
  • 10
  • 78
  • 117
0
votes
1 answer

Check if element contains another

I have this code: $('#detail div p').each(function() { if ($(this).children("i").length) { var TheVar = "Yes"; MyData.push(TheVar); } else { var TheVar = "No"; MyData.push(TheVar); }; }); The problem is that I sometimes get…
user1665355
  • 3,324
  • 8
  • 44
  • 84
0
votes
2 answers

web scraping using cheerio in nodejs?

I am trying web Scraping using cheerio and http in node js part of html code: Sale:
Shubham Batra
  • 2,357
  • 5
  • 29
  • 48
0
votes
0 answers

Cheerio/jQuery will not load element due to limits (I think)

I am using cheerio/jQuery (not sure which one is causing the issue) to search the DOM of a webpage for a large unordered list of items. If the list contains less than 100 elements I can do whatever I want with it. However I have one list that has…
Brian B
  • 310
  • 2
  • 5
0
votes
0 answers

How to adjust node.js console log output?

So i have a script which outputs me answers in different lines like this: 111.111 111 111.111 111 And i want that output would look like this: 111.111:111 111.111:111 Its just putting every second line back and adding a : between them. I…
greyb3ast
  • 79
  • 1
  • 7
0
votes
1 answer

JQuery selector for free floating text node

How would one select only the 'foo' text (and not the span) in this example?
foo ...
Alternatively, what would your search query to figure this out be? I'm at a loss...
AlecPerkey
  • 659
  • 2
  • 11
  • 21
0
votes
1 answer

Using Cheerio and Response for Node web scraper, passing response function result to the view

I'm using this tutorial : https://www.smashingmagazine.com/2015/04/web-scraping-with-nodejs/ To make a really basic node web scraper. I have my app set up and running here: https://[redacted]/ What it is currently doing behind the scenes in my node…
SeanQuinn781
  • 93
  • 11
0
votes
0 answers

Serverside HTML scraping with React instead of Cheerio?

We have a Node.js server doing some HTML scraping (looking for images). Right now we use the Cheerio NPM module to create a virtual DOM from the HTML we retrieve from requests and then traverse with jQuery on the server. However I was wondering if…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

How to remove property from Cheerio object?

I need to get all element except first with Cheerio. So I select all and then try to delete first but after when I try to loop elements I get error that first element undefined... var categories =…
user1564141
  • 5,911
  • 5
  • 21
  • 18
0
votes
1 answer

Node.js using Promises : Promise returns nothing

I'm working on a simple web scraper where I scrape actor/actress names, but I'm getting an error. Could you please check it out, I think I'm doing something wrong. It returns [ReferenceError: options2 is not defined] error. NON WORKING VERSION…
salep
  • 1,332
  • 9
  • 44
  • 93
0
votes
1 answer

Load only part of a large HTML into Cheerio from string. - Matter of efficiancy

I have a very long HTML which i want to scrap using Cheerio.js. I would like to do it in a more efficient way than just load the entire HTML while i need to scrap only 1 specific tag out of it. The tag is: ... here…
TBE
  • 1,002
  • 1
  • 11
  • 32
0
votes
1 answer

nodejs how to retrieve variable value from mysql

I have a piece of code where I want to get the value of a variable from mysql database. var PNOP; connection.query('SELECT pnop FROM MASTER1', [PNOP], function(err, results) { console.log(results); }); The connection query is working fine but…
0
votes
1 answer

Parsing data from html based on a string

I need to extract a particular value from a html page -- the related html content is as below: -html --