I Portion – Power Tools

I Portion Power Tools, Fits The Bill !

Posted by admin On February - 16 - 2012 0 Comment

best online tool store

Patience is a Virtue: Wait Scripts and Visual Web Ripper

A problem faced by web data extractor software is similar to one faced by automatic phone dialers.

When automatic phone dialers first became available, their usefulness was limited due to the delay in receiving a dial tone when the phone line was initially engaged. By the time the line was ready, the dialer had already entered a few digits, causing it to consistently fail. A similar premature extraction can occur when scraping data from web sites.

To overcome this, a Wait Script is necessary when an AJAX Callback is unable to successfully retrieve data due to the webmaster’s use of a transitional word or phrase (typically a blinking “Loading…”) to tell the user the content is rendering. Visual Web Ripper confuses this for the actual data and extracts that unwanted text.

Remember good things come to those who wait. Follow these steps to have Visual Web Ripper extract the data you want.

Note: A working knowledge of OOP, especially in C# and VB.NET is EXTREMELY helpful.

To begin your Wait Script, navigate to your Options menu, click Action, click AJAX or javascript and click Script Wait Condition.

A window pops up, allowing you to manipulate premade code (either in C# or VB.NET). If the code is inaccessible, check Enable wait script.

Your code should look like this at the start:

1. public   static   bool  IsAjaxCallCompleted(WrWaitScriptArguments args)   

2. {   

3.      try   

4.     {   

5.          //Place your condition code here.   

6.          //This example waits until the old content has been replaced with new content,   

7.          //but waits a maximum of 3 seconds.   

8.   

9.          if (args.SecondsWaited>3)   

10.              return   true ;   

11.   

12.          if (!args.OldContent.Equals(args.NewContent))   

13.              return   true ;   

14.   

15.          return   false ;   

16.     }   

17.      catch (Exception exp)   

18.     {   

19.         args.WriteDebug(exp.Message);   

20.              return   true ;   

21.     }   

22. }  

Be aware of some requirements with this solution:

All Wait Scripts must have one method (IsAjaxCallCompleted)

That method must have that exact name, so only change within the body.

The method must return true when the AJAX call has been completed and false otherwise.

The “loading” example would look like this (within the body):

1. try   

2.         {              

3.              if (args.SecondsWaited>3)   

4.                  return   true ;   

5.   

6.              if (!args.OldContent.Equals(args.NewContent) && !args.NewContent.Equals( “Loading…” ))   

7.                  return   true ;   

8.   

9.              return   false ;   

10.         }   

11.          catch (Exception exp)   

12.         {   

13.             args.WriteDebug(exp.Message);   

14.                  return   true ;   

15.         }   

16.     }   

17. }  

Cascading Drop-Down Menus

A cascading drop-down menu is another hurdle that requires special handling when using Visual Web Ripper. Utilize this code to manipulate cascading drop-down menus:

1. try  

2.         {   

3.             if (args.SecondsWaited > 10)   

4.                 return true;   

5.   

6.             if (!args.OldContent.Equals(args.NewContent) && !args.NewText.StartsWith(“[“))   

7.                 return true;   

8.   

9.             return false;   

10.         }   

11.         catch (Exception exp)   

12.         {   

13.             args.WriteDebug(exp.Message);   

14.             return true;   

15.         }   

16.     }   

17. }  

Notes: A FormField element will be needed for every drop-down menu. VWR will wait for every AJAX element to change.

As web sites include an increased set of functionality to enhance user experience, this same functionality requires more powerful web data extraction software. Visual Web Ripper capably delivers in cases like this.

For more information about Best Web Scraping Software Please visit http://www.visualwebripper.com/

FREE Online Business Tools That You Need To Succeed


Cuisinart CSB-76 SmartStick 200-Watt Immersion Hand Blender


Cuisinart CSB-76 SmartStick 200-Watt Immersion Hand Blender



The versatile stick design of the Cuisinart Smart stick Hand Blender lets users blend ingredients right in pots, pitchers, bowls, or clear plastic beaker that’s included. A powerful 200-watt motor operates with an easy one-touch control. Blends drinks, purees soup, mixes pancake and crepe batters in seconds! Both stainless steel blending shaft and beaker are dishwasher-safe….


Culligan FM-15RA Level 3 Faucet Filter Replacement Cartridge


Culligan FM-15RA Level 3 Faucet Filter Replacement Cartridge


$7.99



Presto 114316 04820 PopLite Hot Air Corn Popper


Presto 114316 04820 PopLite Hot Air Corn Popper


$29.99


Plug in Prestos PopLite and the party begins. In less than 2.5 minutes you will have up to 18 cups which is equal to two large bowlfuls of fluffy popcorn with virtually no unpopped kernels. And because the machine uses hot air instead of oil the resulting snack is healthier and lower in calories. Thats not to say you can nott add butter in fact the half cup measuring cup on top of the popper doubl…

Aenima


Aenima


$10.86


All products are BRAND NEW and factory sealed. Fast shipping and 100% Satisfaction Guaranteed….

Lateralus


Lateralus


$11.71


All products are BRAND NEW and factory sealed. Fast shipping and 100% Satisfaction Guaranteed….

Gogol Bordello /Gypsy Punks Underdog World Strike


Gogol Bordello /Gypsy Punks Underdog World Strike


$6.08


All products are BRAND NEW and factory sealed. Fast shipping and 100% Satisfaction Guaranteed….


admin

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin



Subscribe to our Newsletter