Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7801755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:02:32+00:00 2026-06-02T01:02:32+00:00

I am scraping a page using node.js (basically), then jQuerify the result in order

  • 0

I am scraping a page using node.js (basically), then jQuerify the result in order to access the CSS values for some elements. However, for some reason, .css(“something”) always returns an empty value. E.g. .text(), however, is working fine. Any hints? Do I need to output the scraped page first before I can access the CSS?

var request = require('request');
var jsdom = require('jsdom');

var req_url = 'URL';

request({uri: req_url}, function(error, response, html){
    if(!error && response.statusCode == 200){
        var window = jsdom.jsdom(html).createWindow();
        jsdom.jQueryify(window, 'http://code.jquery.com/jquery-1.4.2.min.js', function() {
            var bg = window.$("#ID").css("color");
            console.log(bg);
        });
    }
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:02:33+00:00Added an answer on June 2, 2026 at 1:02 am

    I think that .css() will only return the inline css of a given element.

    Unfortunately what you’re trying to do is hard to do without an active browser.

    You should look into PhantomJS– it combines with node.js easily and acts as a headless webkit that you can inject javascript into.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PhantomJS page.evaluate() to do some scraping. My problem is that the code
I'm using Mechanize for scraping images url then I'm looking http://mechanize.rubyforge.org/Mechanize/Page/Image.html for to know
I am using Web-Harvest to do some web page scraping. I have a table
I'm using BeautifulSoup to do some screen-scraping. My problem is this: I need to
So here is the string that im scraping a page to read (using file
I am scraping a list of RSS feeds by using cURL, and then I
I'm scraping a page, however before my content is echoed I would like to
I'm using simple_html_dom_helper so do some screen scraping and am encountering some errors. The
I am doing some screen scraping work at the moment using PHP and Simple
i'm trying to get the html of a page using this screen scraping in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.