RSS

Web scraping using firefox & jQuery

18 Nov

Hello Friends,

Today we will scrape HTML from any web page using jQuery and firefox firebug console. This is useful when you want to grab HTML of web page dynamically created by JavaScript or Ajax.

This example is quite useful when you want to extract any web content based on HTML Tag element ID or Class like ‘<div id=”svnlabs”></div>’ or ‘<img src=”svnlabs.jpg” id=”svn_labs”>’

See the code in action here… scraper.txt

jQuery(“body”).append(‘<textarea id=”svnlabs” cols=”70″ rows=”20″></textarea>’);

jQuery(“#svnlabs”).val(jQuery(“body”).html());

OR

copy and paste below code in browser address bar….

javascript: jQuery(“body”).append(‘<textarea id=”svnlabs” cols=”70″ rows=”20″></textarea>’); jQuery(“#svnlabs”).val(jQuery(“body”).html());

You have to post above code in firefox firebug javascript console. The latest jQuery library must be included on that web page you want to scrap 😉
Above two JavaScript lines will add a new textarea in body of same web page to set content of any HTML element. Please make sure after copy the above code; no illegal character in it.

Keep blogging……… 😉

Advertisements
 
13 Comments

Posted by on November 18, 2010 in javascript, Launch, Open Source, Tips, Tricks

 

Tags: , , , , , , ,

13 responses to “Web scraping using firefox & jQuery

  1. pharmacy technician

    November 18, 2010 at 2:56 pm

    My cousin recommended this blog and she was totally right keep up the fantastic work!

     
  2. pharmacy technician

    November 21, 2010 at 2:38 am

    nice post. thanks.

     
  3. Michael jackson beat it

    December 18, 2010 at 4:44 pm

    Thank you! Fabulous resource – now I don’t have to keep searching 🙂

     
  4. Bucknell University

    December 28, 2010 at 5:15 pm

    This is indeed a fantastic resource. Thank you for making this publicly available.

     
  5. Diario Extra

    December 31, 2010 at 9:43 pm

    Great article, lots of smart tips. I am going to show my buddies and ask them what they think.

     
  6. Web Scraping Tool

    January 2, 2011 at 9:56 pm

    Hi,

    This is the marvellous post that I have come over after huge searches. I am really thankful to you for providing this unique information.

     
  7. provides access

    January 16, 2011 at 5:48 pm

    I am looking forward to looked over way more of your current well written articles, have a pleasant day!

     
  8. painter 11

    January 17, 2011 at 2:10 am

    Great job on the blog, it looks great. I am going to bookmark it and will make sure to check back weekly

     
  9. provides access

    January 17, 2011 at 7:28 pm

    Thank you! Fabulous resource – now I don’t have to keep searching 🙂

     
  10. PeterWat

    January 20, 2011 at 1:40 pm

    A noteworthy affiliate site of bwin. Offers a myriad of trustworthy links and options.. http://bwin.mu

     
  11. Swessspeabs

    January 30, 2011 at 11:02 pm

    Tak, prawdopodobnie tak jest

     
  12. Extract Data From Web

    February 7, 2011 at 2:54 am

    Really it is a nice blog, I would like to tell you that you have given me much knowledge about it.

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: