Latest Inquiries - Data Extraction Software

troubles with inputs to an ajax form

Submitted: 12/1/2017
Hi

I have a table used for the inputs using a list of dates. (calender table attached and bot)

I'm trying to feed these dates into the forms. If i manually type things in the calender updates fine but not with this input dates. Its the correct format and everything. Then on apply does not update to the first of this year at all. Its probably one option ive missed but cant figure it out.

Any help would be welcomed.

Thanks
dumps.zip

Replied: 12/5/2017 3:19:52 PM
using  System;   
    using  VisualWebRipper.Internal.SimpleHtmlParser;   
    using  VisualWebRipper;   
public   class  Script   
{   
    public   static  object  TransformContent(WrContentTransformationArguments args)   
    {   
        try   
        {   
            return  args.InputDataRow["date"];
            
        }   
        catch  (Exception exp)   
        {   
            //Place error handling here   
            args.WriteDebug(exp.Message);   
            return   "Custom script error" ;   
        }   
    }   
}

ok that displays the date part

this is the variable/tag "start" (transformation)
<input name="ctl00$ContentPlaceHolder1$ctl03$startDate" class="form-control" id="startDate" type="text" value="2017-07-05">

How do i insert the date into
<input name="ctl00$ContentPlaceHolder1$ctl03$startDate" class="form-control" id="startDate" type="text" value="INSERTFROMINPUTS"
>

Then it should transform the webpage to the correct date.

I have one for start and end variables in the main editor.

Any help here would be welcomed!


Replied: 12/5/2017 2:59:24 PM
Hi there

I have the inputs with all the dates

this is the form layout

<input name="ctl00$ContentPlaceHolder1$ctl03$startDate" class="form-control" id="startDate" type="text" value="2017-01-05">

as a regex test ive simply replaced it with a manual date

(.*)
return $1
value="(.*)"
replace value="2017-01-05""

transforms the page content into that new date for both input fields..... now on submit it works fine and updates that page then extracts all the content

How do i take the list of input dates and transform this content each time it comes to this form?

Would i need a C script to access to the database for the inputs and replace for each row?... im not sure how to syncronise for each input date then onto the next input date etc

this works so far as a tester. Any help here or example
 how do you  take input dates and pass that to transform webpage part and insert into that value ???










Replied: 12/5/2017 6:54:28 AM

Hi Brian,

Finding the right Action Events to activate the javascript to change the calendar and data could be very difficult and time-consuming and will not be part of our free support. Sadly to say but it is only feasible in Content Grabber. We offer a discount on every VWR users when it buys Content Grabber (Perpetual License only). 

 Best regards,

Replied: 12/5/2017 4:42:30 PM
using  System;   
using  VisualWebRipper.Internal.SimpleHtmlParser;   
using  VisualWebRipper;  
using System.Text.RegularExpressions;
public   class  Script   
{   
    public   static  string  TransformContent(WrContentTransformationArguments args)   
    {   
        try   
        {       
        
            Match match = Regex.Match(args.Content, "(.*)([value=\"])(.*?)(\">)", RegexOptions.IgnoreCase);
            if (match.Success)
            
            args.Content = match.Groups[1].Value + args.InputDataRow["date"];
            return args.Content;
            
            
        }   
        catch  (Exception exp)   
        {   
            //Place error handling here   
            args.WriteDebug(exp.Message);   
            return   "Custom script error" ;   
        }   
    }   
}

from extracted data from content

<input name="ctl00$ContentPlaceHolder1$ctl03$startDate" class="form-control" id="startDate" type="text" value="2017-07-05">

output is

<input name="ctl00$ContentPlaceHolder1$ctl03$startDate" class="form-control" id="startDate" type="text" value=01/01/2017

what am i doing wrong with the escapes it should be value="01/01/2017"

any ideas

thanks






Replied: 12/4/2017 11:45:13 AM
thats the thing i type in the browser editor window it updates fine... just when on input its as if it needs away to double click the field. try and type in the calender window.. you will see it works fine!... so i dont think its a browser limit as it wouldnt work at all. content grabber is way to expensive.
Replied: 12/5/2017 3:33:30 PM
return  args.Content +  " "  + args.InputDataRow["date"];

shows this

<input name="ctl00$ContentPlaceHolder1$ctl03$startDate" class="form-control" id="startDate" type="text" value="2017-07-05"> 01/01/2017

so nearly how do i regex or insert that into value=" "


Replied: 12/5/2017 3:00:08 PM
<input name="ctl00$ContentPlaceHolder1$ctl03$startDate" class="form-control" id="startDate" type="text" value="2017-08-05">

different date...
Replied: 12/4/2017 9:17:40 AM

Hi Brian,

VWR can't handle the ajax very well and finding the combination of action events to activate the calendar and successfully update the results could be very very difficult if not impossible. This type of action is available only in our premium scraper, Content Grabber. I have many advanced features and it is using Chromium (the source code of Chrome) compared with Internet Explorer of VWR. 

I created a sample agent for Investing.com, see attached, and it can handle the ajax form very well. Just download the trial version and open the SCGX file.

Best regards,

investing.zip

Replied: 12/5/2017 3:05:27 PM
For each input date it would send this to transform

<input name="ctl00$ContentPlaceHolder1$ctl03$startDate" class="form-control" id="startDate" type="text" value="2017-01-01">
<input name="ctl00$ContentPlaceHolder1$ctl03$startDate" class="form-control" id="startDate" type="text" value="2017-01-02">
<input name="ctl00$ContentPlaceHolder1$ctl03$startDate" class="form-control" id="startDate" type="text" value="2017-01-03">

etcetc

then each page and its data should be fine.

I really need your help here and I dont know anyone who can explain what your software does than you!
Replied: 12/5/2017 4:55:32 PM
args.Content = match.Groups[1].Value + "\"" + args.InputDataRow["date"]+ "\"";

unbelievable .... typical ! lol

anyway i think its solved. one way around this ajax issue!
Replied: 12/7/2017 3:49:09 AM

Hi Brian,

Glad to know you find the solution. As I said, we need to spend more time to find a solution since we have to examine the website more deeply to find the solution which will not part of our free support as it involves more hours. 

Best regards,