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

Node.js limiting concurrent connections (requests)

I'm using Request, Cheerio and Node.js I need to limit concurrent requests to 10. I want to process URL's in parallel but not in the same time, hope it's clear. Here's my current script. If I run my for loop from 0 to 100, it works. 100 to 200, it…
salep
  • 1,332
  • 9
  • 44
  • 93
0
votes
2 answers

Trouble using nested callbacks in NodeJS

I'm writing a program that scrapes a site for links, then scrapes these links for information. In order to scrape the site, it is necessary to log in first. And so the order is: Log in -> Scrape the index for links -> Scrape the links for info The…
tsorn
  • 3,365
  • 1
  • 29
  • 48
0
votes
0 answers

Append html-element to file with node.js-script

Using Node.js server with Reload for front-end development. Don't want to include reload.js-script loading in index.html. Trying to use Node-script for appending it via development server. var request = require('request'); var cheerio =…
IJK
  • 11
  • 1
  • 5
0
votes
1 answer

Node js console.log is not showing anything

I'm trying to scrap a webpage using node js.I think I've written the code and was able to run it without any errors but the problem is the console doesn't print anything no matter what I do.It is not showing any errors. What's the reason? Here is…
user3407278
  • 1,233
  • 5
  • 16
  • 32
0
votes
1 answer

How to make an asynchronous function in Node JS

I'm using Cheerio each function to parse some URLS and save all the data into MongoDB. my problem is that cheerio each function as synchronous. and I don't know when the parsing is ended to start to do something else. so How to make these functions…
Stranger B.
  • 9,004
  • 21
  • 71
  • 108
0
votes
1 answer

How can i assign value to a global variable in node.js?

I met a problem recently: How can i assign value to a global variable? when i try to return a, i found that is undefined, and the "value" i wanna to assign to it is not undefined. my code is like this: module.exports = function (jsonStr) { var…
Leyla Lee
  • 466
  • 5
  • 19
0
votes
1 answer

Retrieving HTML metadata for image instead of downloading image

I am trying to use Cheerio with the Node.js request library to retrieve metadata about images. It looks like when I make an HTTP GET request to an URL that ends in .jpg, .png, etc, it will send back the whole file and I can't access the HTML in the…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
0 answers

Unable to find DOM element using Cheerio

I had did same thing in JQuery (http://jsfiddle.net/nkishore518/e98b0brb/10/) it is working, but in node.js it is not showing any result and there is no error also. please help me what I had missed. var request = require('request'); var cheerio =…
Kishore Reddy
  • 886
  • 3
  • 11
  • 19
0
votes
1 answer

Cheerio changing single quotas into double

I am using cheerio to modify HTML that i am scraping from a website. However it is messing up quoats. This script works fine, the only issue is, it is changing ' to " // Load in HTML $ = cheerio.load(string); …
Jay Povey
  • 127
  • 1
  • 11
0
votes
2 answers

jquery selectors: a repeated use case

I have to parse an html page organized this way:
  • EFG
  • 0
    votes
    1 answer

    jquery selectors: a not so uncommon use case

    I am changing a question inserted yesterday, and answered correctly. I have to parse an html page organized this way:
  • MarcoS
    • 17,323
    • 24
    • 96
    • 174
    0
    votes
    3 answers

    jquery selectors: an uncommon use case

    I have to parse an html page organized this way:
  • Cities
  • MarcoS
    • 17,323
    • 24
    • 96
    • 174
    0
    votes
    1 answer

    Javascript "is not a function" error

    I'm trying to run a simple cheerio scraping script here: var $ = cheerio.load(body); var scoresTable = $('.grey').html(); var scoresTableTbody = scoresTable('tbody'); console.log(scoresTableTbody); But the return…
    jwitos
    • 492
    • 3
    • 7
    • 24
    0
    votes
    1 answer

    Cheerio scraping returning only two rows

    So I tested my scraping on a static HTML file before adding it to my Node app. The problem is that it's not returning all the rows. On the site: $('#sport tr').length //Returns 13 In Cheerio: $('#sport tr').length //Returns 2 I'm stumped,…
    ZeroBased_IX
    • 2,667
    • 2
    • 25
    • 46
    0
    votes
    1 answer

    Selectors within an each loop

    So I just started with Cheerio the other day. I have a situation where I have several divs to iterate over and based on its childrens' contents I have to do different things. The basic HTML structure:
    ...
    Vangogh500
    • 939
    • 1
    • 7
    • 17
    1 2 3
    99
    100