• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript Very New to Javascript

gurunath

New Coder
Hi,

I am studying Astrology.

I am trying to download some data from a certain website into Excel Cell "B2" and subsequent entries below "B2" for my study but could not because of the javascript.

I have some basic knowledge of VBA but very new to Java.

I am trying to collect some data from the following website.

"https://www.chaosastrologer.com/astroform/ephemeris.cfm"

The following code can be found in "https://chaosastrologer.com/js/dateBox.js"



Code:
/*
dateBox.js 2002-01-09

Author(s): Serge Ryabcuck, z555.com, Copyright 2002

z555.com grants you a royalty free license to use or modify this
software provided that this copyright notice appears on all copies.
This software is provided "AS IS," without a warranty of any kind.
*/


/* ToDo

 - Masks like dd/mm/yyyy, mm/dd/yyyy, etc.
 - Redraw of the object after change of object style properties.
 - Rewrite some object methods for conforming with initial idea 
   and remoe direct HTML objects calls for properties duplicates
  
*/

window.dbIE  = document.all ? true : false;                                // IE 4+
window.dbDOM = (document.getElementById && ! document.all) ? true : false; // NS6, Mozilla, other DOM2 compartible browsers


function dateBox(name, month, day, year) {
   this.name            = name;
   this.day             = day;
   this.month           = month;
   this.year            = year;
   //this.id;
   this.version         = "2.0.1 [Date Box; 20020109] ";
   this.type            = "dateBox";
   this.startYear       = 1860;
   this.endYear         = 2130;
   this.height          = 28;
   this.shortMonthWidth = 47;
   this.longMonthWidth  = 110;
   this.dayWidth        = 50;
   this.yearWidth       = 68;
   this.fontFamily      = 'Verdana, Arial, Helvetica, sans-serif';
   this.fontSize        = '11pt';
   this.dateBoxStyle    = 'long';

        
   this.shortMonth = [ 'Jan', 'Feb', 'Mar',
                       'Apr', 'May', 'Jun',
                       'Jul', 'Aug', 'Sep',
                       'Oct', 'Nov', 'Dec'
                     ];

   this.longMonth  = [ 'January', 'February', 'March',
                       'April', 'May', 'June',
                       'July', 'August', 'September',
                       'October', 'November', 'December'
                     ];
                                        
// Other Properties;                                     

   //this.HTMLcontainer;
   //this.objForm;
   //this.objMonth;
   //this.objDay;
   //this.objYear;
        
// Methods
        
   this.getName            = getName;
        
   this.setDay             = setDay;
   this.getDay             = getDay;
        
   this.setMonth           = setMonth;
   this.getMonth           = getMonth;

   this.setYear            = setYear;
   this.getYear            = getYear;

   this.getID              = getID;
        
   this.setStartYear       = setStartYear;
   this.getStartYear       = getStartYear;
   this.setEndYear         = setEndYear;
   this.getEndYear         = getEndYear;
        
   this.getDateBoxStyle    = getDateBoxStyle;
        
   this.setHeight          = setHeight;
   this.getHeight          = getHeight;
        
   this.setShortMonth      = setShortMonth;
   this.getShortMonth      = getShortMonth;

   this.setLongMonth       = setLongMonth;
   this.getLongMonth       = getLongMonth;
        
   this.getMonthWidth      = getMonthWidth;
        
   this.setDayWidth        = setDayWidth;
   this.getDayWidth        = getDayWidth;
        
   this.setYearWidth       = setYearWidth;
   this.getYearWidth       = getYearWidth;

   this.getMonthName       = getMonthName;

   this.setFontFamily      = setFontFamily;
   this.getFontFamily      = getFontFamily;

   this.setFontSize        = setFontSize;
   this.getFontSize        = getFontSize;
        
   this.setObjPointers     = setObjPointers;
   this.makeDateHTML       = makeDateHTML;
   this.printHTML          = printHTML;
   this.monthDays          = monthDays;
   this.limitList          = limitList
        
   this.getObjForm         = getObjForm;
   this.getObjDay          = getObjDay;
   this.getObjMonth        = getObjMonth;
   this.getObjYear         = getObjYear;
        
   this.getObjSelectedDate = getObjSelectedDate;
   this.setRawDate         = setRawDate;
   this.setObjDate         = setObjDate;
                
//Events
   this.onSelectDate       = onSelectDate;

   var curDate = new Date();
   if (!month) { this.month = curDate.getMonth()+1 };
   if (!day)   { this.day   = curDate.getDate() };
   if (!year)  {
       if (window.dbDOM) {             
           this.year  = curDate.getYear()+1900;
        } else {
           this.year  = curDate.getYear();
        }
   };
        
   if (!window.dateBoxes) window.dateBoxes = new Array();
   this.id=window.dateBoxes.length;
   window.dateBoxes[window.dateBoxes.length] = this;
        
}

/////////////////////////////////////////////////////////////
// dateBox.getName()
function getName() {
   return this.name;
}               

/////////////////////////////////////////////////////////////
// dateBox.setDay()
function setDay(day) {
   this.day=day;
}               

/////////////////////////////////////////////////////////////
// dateBox.getDay()
function getDay() {
   return this.day;
}               

/////////////////////////////////////////////////////////////
// dateBox.setMonth()
function setMonth(month) {
   this.month = month;
}               

/////////////////////////////////////////////////////////////
// dateBox.getMonth()
function getMonth() {
   return this.month;
}               

/////////////////////////////////////////////////////////////
// dateBox.setYear()
function setYear(year) {
   this.year=year;
}               

/////////////////////////////////////////////////////////////
// dateBox.getYear()
function getYear() {
   return this.year;
}               

/////////////////////////////////////////////////////////////
// dateBox.getID()
function getID() {
   return this.id;
}               

/////////////////////////////////////////////////////////////
// dateBox.setStartYear()
function setStartYear(year) {
   this.startYear = year;
}               

/////////////////////////////////////////////////////////////
// dateBox.getStartYear()
function getStartYear() {
   return this.startYear;
}               

/////////////////////////////////////////////////////////////
// dateBox.setEndYear()
function setEndYear(year) {
   this.endYear = year;
}               

/////////////////////////////////////////////////////////////
// dateBox.getEndYear()
function getEndYear() {
   return this.endYear;
}               

/////////////////////////////////////////////////////////////
// dateBox.getDateBoxStyle()
function getDateBoxStyle() {
   return this.dateBoxStyle;
}

/////////////////////////////////////////////////////////////
// dateBox.setShortMonth()
function setShortMonth(monthArray) {
   this.shortMonth=monthArray;
}

/////////////////////////////////////////////////////////////
// dateBox.getShortMonth()
function getShortMonth(monthIndex) {
   return this.shortMonth[monthIndex-1];
}

/////////////////////////////////////////////////////////////
// dateBox.setLongMonth()
function setLongMonth(monthArray) {
   this.longMonth=monthArray;
}

/////////////////////////////////////////////////////////////
// dateBox.getLongMonth()
function getLongMonth(monthIndex) {
   return this.longMonth[monthIndex-1];
}

/////////////////////////////////////////////////////////////
// dateBox.getMonthName()
function getMonthName(monthIndex) {
   if (this.getDateBoxStyle() == 'short') {
      return this.getShortMonth(monthIndex);
   } else {
      return this.getLongMonth(monthIndex);
   }
}

/////////////////////////////////////////////////////////////
// dateBox.setHeight()
function setHeight(height) {
   this.height = height;
}               

/////////////////////////////////////////////////////////////
// dateBox.getHeight()
function getHeight() {
   return this.height;
}

/////////////////////////////////////////////////////////////
// dateBox.setShortMonthWidth()
function setShortMonthWidth(width) {
   this.shortMonthWidth = width;
}               

/////////////////////////////////////////////////////////////
// dateBox.setLongMonthWidth()
function setLongMonthWidth(width) {
   this.longMonthWidth = width;
}               

/////////////////////////////////////////////////////////////
// dateBox.getMonthWidth()
function getMonthWidth() {
   if (this.getDateBoxStyle() == 'short') {
      return this.shortMonthWidth;
   } else {
      return this.longMonthWidth;
   }
}

/////////////////////////////////////////////////////////////
// dateBox.setDayWidth()
function setDayWidth(width) {
   this.dayWidth = width;
}               

/////////////////////////////////////////////////////////////
// dateBox.getDayWidth()
function getDayWidth() {
   return this.dayWidth;
}

/////////////////////////////////////////////////////////////
// dateBox.setYearWidth()
function setYearWidth(width) {
   this.yearWidth = width;
}               

/////////////////////////////////////////////////////////////
// dateBox.getYearWidth()
function getYearWidth() {
   return this.yearWidth;
}

/////////////////////////////////////////////////////////////
// dateBox.setFontFamily()
function setFontFamily(family) {
   this.fontFamily=family;
}

/////////////////////////////////////////////////////////////
// dateBox.getFontFamily()
function getFontFamily() {
   return this.fontFamily;
}

/////////////////////////////////////////////////////////////
// dateBox.setFontSize()
function setFontSize(size) {
   this.fontSize=size;
}

/////////////////////////////////////////////////////////////
// dateBox.getFontSize()
function getFontSize() {
   return this.fontSize;
}

/////////////////////////////////////////////////////////////
// dateBox.getObjForm()
function getObjForm() {
   return this.objForm;
}

/////////////////////////////////////////////////////////////
// dateBox.getObjDay()
function getObjDay() {
   return this.objDay;
}

/////////////////////////////////////////////////////////////
// dateBox.getObjMonth()
function getObjMonth() {
   return this.objMonth;
}

/////////////////////////////////////////////////////////////
// dateBox.getObjYear()
function getObjYear() {
   return this.objYear;
}

/////////////////////////////////////////////////////////////
// dateBox.makeDateHTML()
function makeDateHTML() {
   var dateStr = "";
                
   // Build Month
   dateStr += '<select name="' + this.getName() + 'Month' +
              '" style="font-family : ' + this.getFontFamily() +
              '; HEIGHT: ' + this.getHeight() + 'px; WIDTH:' +
              this.getMonthWidth() + 'px; font-size: ' + this.getFontSize() +
              ';" onChange="window.dateBoxes[' + this.getID() + '].onSelectDate()">';

   for (i=1; i<=12;i++) {
       if (this.getMonth() == i) {
          dateStr += '<option selected value=' + i + '>' + this.getMonthName(i);
       } else {
          dateStr += '<option value=' + i + '>' + this.getMonthName(i);
       }
   }
   dateStr += "</select>";

   // Build Day
   dateStr += '<select name="' + this.getName() + 'Day' +
              '" style="font-family : ' + this.getFontFamily() +
              '; HEIGHT: ' + this.getHeight() + 'px; WIDTH: ' +
              this.getDayWidth() + 'px; font-size: ' + this.getFontSize() +
              ';"  onChange="window.dateBoxes[' + this.getID() +
              '].onSelectDate()">';

   for (i=1; i<=31; i++) {
       if (this.getDay() == i) {
           dateStr += '<option selected>'+i;
       } else {
         dateStr += '<option>'+i;
       }
   }
   dateStr += "</select>";

   // Build Year
   dateStr += '<select name="' + this.getName() + 'Year' +
              '" style="font-family : ' + this.getFontFamily() + '; HEIGHT: ' +
              this.getHeight() + 'px; WIDTH: ' + this.getYearWidth() +
              'px; font-size: ' + this.getFontSize() +
              ';" onChange="window.dateBoxes[' + this.getID() + '].onSelectDate()">';
                        
   for (i=this.getStartYear(); i<=this.getEndYear(); i++) {
        if (this.getYear() == i) {
           dateStr += '<option selected>' + i;
        } else {
           dateStr += '<option>' + i;
        }
   }
   dateStr += "</select>";
        
   this.HTMLcontainer=dateStr;     
}

/////////////////////////////////////////////////////////////
// dateBox.printHTML()
function printHTML() {
   document.write(this.HTMLcontainer);
   this.setObjPointers(document.forms[document.forms.length-1]);
   this.limitList(this.monthDays(this.getMonth(),this.getYear()));
}

/////////////////////////////////////////////////////////////
// dateBox.setObjPointers()
function setObjPointers(form) {
   this.objForm  = form;
   this.objDay   = eval("form."+this.getName()+"Day");
   this.objMonth = eval("form."+this.getName()+"Month");
   this.objYear  = eval("form."+this.getName()+"Year");
}

// How many days in the month?
/////////////////////////////////////////////////////////////
// dateBox.monthDays()
function monthDays(month,year) {
   var day = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
   month--;
   if ((year % 4 == 0) && (month==1)) {
       if (year % 100 == 0) {
          if (year % 400 == 0) {
              return 29;
          } else {
              return 28;
          }
       } else {
          return 29;
       }   
  } else {
     return day[month];
  }
}       

// Event processor
/////////////////////////////////////////////////////////////
// dateBox.onSelectDate()
function onSelectDate() {
   if (window.dbIE || window.dbDOM) {
      var objDay=this.getObjDay();
      var objYear=this.getObjYear();
      var objMonth=this.getObjMonth();

      yearVal=objYear.options[objYear.selectedIndex].text;
      monthVal=objMonth.options[objMonth.selectedIndex].value;
      this.limitList(this.monthDays(monthVal,yearVal));

      this.setDay(objDay.selectedIndex+1);
      this.setMonth(objMonth.selectedIndex+1);
      this.setYear(objYear.selectedIndex+this.startYear);
   }
}

//Rebuilds dropdown list of day options according to the month
/////////////////////////////////////////////////////////////
// dateBox.limitList()
function limitList(length) {
   list=this.getObjDay();
   if (length<(list.selectedIndex+1)) {
      list.selectedIndex=length-1;
   }
   if (window.dbIE || window.dbDOM) {
      if (list.options.length<length) {
         for (var i=list.options.length+1; i<=length; i++) {
             var oOption = document.createElement('OPTION');
             if (window.dbIE) {
                list.options.add(oOption);
                oOption.innerText = i;
                oOption.Value = i;
             } else if (window.dbDOM) {     
                oOption.text = ' '+i;
                oOption.Value = i;
                list.add(oOption,null);
             }
          }
      } else if (list.options.length>length) {
         for (var i=list.options.length; i>=length; i--) {
             list.remove(i);
         }               
      }
  }
}

// Convert form fields to Date object
/////////////////////////////////////////////////////////////
// dateBox.getObjSelectedDate()
function getObjSelectedDate() {
   if (window.dbIE || window.dbDOM) {
      var objDay=this.getObjDay();
      var objYear=this.getObjYear();
      var objMonth=this.getObjMonth();
                
      var day=objDay.options[objDay.selectedIndex].text;
      var month=objMonth.options[objMonth.selectedIndex].value-1;
      var year=objYear.options[objYear.selectedIndex].text;
                
      var dateObj = new Date(year, month, day);
      return dateObj;
   }
}

// Set specified Date
/////////////////////////////////////////////////////////////
// dateBox.setRawDate()
function setRawDate(month,day,year) {
   if (window.dbIE || window.dbDOM) {
      var objDay=this.getObjDay();
      var objYear=this.getObjYear();
      var objMonth=this.getObjMonth();

      this.limitList(this.monthDays(month,year));                   
      objDay.selectedIndex=day-1;
      objMonth.selectedIndex=month-1;
      objYear.selectedIndex=year-this.startYear;
   }
}

/////////////////////////////////////////////////////////////
// dateBox.setObjDate()
function setObjDate(date){
   if (window.dbIE || window.dbDOM) {
       var month = date.getMonth()+1;
       var day   = date.getDate();
       if (window.dbDOM) {             
          var year  = date.getYear()+1900;
       } else {
          var year  = date.getYear();
       }
       this.setRawDate(month,day,year);
   }
}




The second code is
This code can be found in "https://www.chaosastrologer.com/cf_scripts/scripts/cfform.js"



Code:
var _CF_error_messages=new Array();
var _CF_error_fields=new Object();
var _CF_FirstErrorField=null;
var _CF_submit_status=new Array();
_CF_signalLoad=function(){
_CF_loaded=1;
};
_CF_onError=function(_91c,_91d,_91e,_91f){
if(_CF_error_fields[_91d]==null){
if(_CF_FirstErrorField==null){
_CF_FirstErrorField=_91d;
}
_CF_error_exists=true;
_CF_error_fields[_91d]=_91f;
_CF_error_messages[_CF_error_messages.length]=_91f;
}
};
_CF_onErrorAlert=function(_920){
var _921="";
for(var i=0;i<_920.length;i++){
_921+=_920[i]+"\n";
}
alert(_921);
return false;
};
updateHiddenValue=function(val,form,name){
if(form==null||form==""){
form=0;
}
if(document.forms[form]==null||document.forms[form][name]==null){
return;
}
document.forms[form][name].value=val;
};
_CF_hasValue=function(obj,_927,_928){
if(_927=="TEXT"||_927=="FILE"||_927=="PASSWORD"||_927=="CFTEXTAREA"||_927=="TEXTAREA"||_927=="CFTEXTINPUT"||_927=="DATEFIELD"){
if(obj.value.length==0){
return false;
}else{
if(_928){
str=obj.value.replace(/^\s+/,"").replace(/\s+$/,"");
if(str.length==0){
return false;
}
}
}
return true;
}else{
if(_927=="SELECT"){
for(i=0;i<obj.length;i++){
if(obj.options[i].selected&&obj.options[i].value.length>0){
return true;
}
}
return false;
}else{
if(_927=="SINGLE_VALUE_RADIO"||_927=="SINGLE_VALUE_CHECKBOX"){
if(obj.checked){
return true;
}else{
return false;
}
}else{
if(_927=="RADIO"||_927=="CHECKBOX"){
if(obj.length==undefined&&obj.checked){
return true;
}else{
for(i=0;i<obj.length;i++){
if(obj[i].checked){
return true;
}
}
}
return false;
}else{
if(_927=="CFTREE"){
if(obj["value"].length>0){
return true;
}else{
return false;
}
}else{
if(_927=="RICHTEXT"){
var _929=FCKeditorAPI.GetInstance(obj.id);
var val=_929.GetXHTML();
if(val.length==0){
return false;
}else{
if(_928){
str=val.replace(/^\s+/,"").replace(/\s+$/,"");
if(str.length==0){
return false;
}
}
return true;
}
}else{
return true;
}
}
}
}
}
}
};
_CF_checkdate=function(_92b,_92c){
_92b=_92b.replace(/^\s+/,"").replace(/\s+$/,"");
_92b=_92b=_92b.replace(/{d \'/,"").replace(/'}/,"");
if(_92c){
if(_92b.length==0){
return false;
}
}else{
if(_92b.length==0){
return true;
}
}
if(_92b.length==0){
return true;
}
isplit=_92b.indexOf("/");
splitchr="/";
if(isplit==-1){
isplit=_92b.indexOf(".");
splitchr=".";
}
if(isplit==-1){
isplit=_92b.indexOf("-");
splitchr="-";
}
if(isplit==-1||isplit==_92b.length){
return false;
}
var _92d=_92b.substring(0,isplit);
if(_92d.length==4){
sYear=_92b.substring(0,isplit);
isplit=_92b.indexOf(splitchr,isplit+1);
if(isplit==-1||(isplit+1)==_92b.length){
return false;
}
sMonth=_92b.substring((sYear.length+1),isplit);
sDay=_92b.substring(isplit+1);
}else{
sMonth=_92b.substring(0,isplit);
isplit=_92b.indexOf(splitchr,isplit+1);
if(isplit==-1||(isplit+1)==_92b.length){
return false;
}
sDay=_92b.substring((sMonth.length+1),isplit);
sYear=_92b.substring(isplit+1);
}
if((sDay.length==0)||(sMonth.length==0)||(sYear.length==0)){
return false;
}
if(!_CF_checkinteger(sMonth)){
return false;
}else{
if(!_CF_checkrange(sMonth,1,12)){
return false;
}else{
if(!_CF_checkinteger(sYear)){
return false;
}else{
if(sYear.length!=1&&sYear.length!=2&&sYear.length!=4){
return false;
}else{
if(!_CF_checkrange(sYear,0,9999)){
return false;
}else{
if(!_CF_checkinteger(sDay)){
return false;
}else{
if(!_CF_checkday(sYear,sMonth,sDay)){
return false;
}else{
return true;
}
}
}
}
}
}
}
};
_CF_checkeurodate=function(_92e,_92f){
_92e=_92e.replace(/^\s+/,"").replace(/\s+$/,"");
_92e=_92e=_92e.replace(/{d \'/,"").replace(/'}/,"");
if(_92f){
if(_92e.length==0){
return false;
}
}else{
if(_92e.length==0){
return true;
}
}
isplit=_92e.indexOf("/");
splitchr="/";
if(isplit==-1){
isplit=_92e.indexOf(".");
splitchr=".";
}
if(isplit==-1){
isplit=_92e.indexOf("-");
splitchr="-";
}
if(isplit==-1||isplit==_92e.length){
return false;
}
var _930=_92e.substring(0,isplit);
if(_930.length==4){
sYear=_92e.substring(0,isplit);
isplit=_92e.indexOf(splitchr,isplit+1);
if(isplit==-1||(isplit+1)==_92e.length){
return false;
}
sMonth=_92e.substring((sYear.length+1),isplit);
sDay=_92e.substring(isplit+1);
}else{
sDay=_92e.substring(0,isplit);
isplit=_92e.indexOf(splitchr,isplit+1);
if(isplit==-1||(isplit+1)==_92e.length){
return false;
}
sMonth=_92e.substring((sDay.length+1),isplit);
sYear=_92e.substring(isplit+1);
}
if(!_CF_checkinteger(sMonth)){
return false;
}else{
if(!_CF_checkrange(sMonth,1,12)){
return false;
}else{
if(!_CF_checkinteger(sYear)){
return false;
}else{
if(!_CF_checkrange(sYear,0,null)){
return false;
}else{
if(!_CF_checkinteger(sDay)){
return false;
}else{
if(!_CF_checkday(sYear,sMonth,sDay)){
return false;
}else{
return true;
}
}
}
}
}
}
};
_CF_checkday=function(_931,_932,_933){
maxDay=31;
if(_932==4||_932==6||_932==9||_932==11){
maxDay=30;
}else{
if(_932==2){
if(_931%4>0){
maxDay=28;
}else{
if(_931%100==0&&_931%400>0){
maxDay=28;
}else{
maxDay=29;
}
}
}
}
return _CF_checkrange(_933,1,maxDay);
};
_CF_checkinteger=function(_934,_935){
_934=_934.replace(/^\s+/,"").replace(/\s+$/,"");
_934=_934.replace(/[$£¥€,~+]?/g,"");
if(_935){
if(_934.length==0){
return false;
}
}else{
if(_934.length==0){
return true;
}
}
var _936=".";
var _937=_934.indexOf(_936);
if(_937==-1){
return _CF_checknumber(_934);
}else{
return false;
}
};
_CF_numberrange=function(_938,_939,_93a,_93b){
if(_93b){
if(_938.length==0){
return false;
}
}else{
if(_938.length==0){
return true;
}
}
if(_939!=null){
if(_938<_939){
return false;
}
}
if(_93a!=null){
if(_938>_93a){
return false;
}
}
return true;
};
_CF_checknumber=function(_93c,_93d){
var _93e=" .+-0123456789";
var _93f=" .0123456789";
var _940;
var _941=false;
var _942=false;
var _943=false;
_93c=_93c.replace(/^\s+/,"").replace(/\s+$/,"");
_93c=_93c.replace(/[$£¥€,~+]?/g,"");
if(_93d){
if(_93c.length==0){
return false;
}
}else{
if(_93c.length==0){
return true;
}
}
_940=_93e.indexOf(_93c.charAt(0));
if(_940==1){
_941=true;
}else{
if(_940<1){
return false;
}
}
for(var i=1;i<_93c.length;i++){
_940=_93f.indexOf(_93c.charAt(i));
if(_940<0){
return false;
}else{
if(_940==1){
if(_941){
return false;
}else{
_941=true;
}
}else{
if(_940==0){
if(_941||_943){
_942=true;
}
}else{
if(_942){
return false;
}else{
_943=true;
}
}
}
}
}
return true;
};
_CF_checkrange=function(_945,_946,_947,_948){
_945=_945.replace(/^\s+/,"").replace(/\s+$/,"");
if(_948){
if(_945.length==0){
return false;
}
}else{
if(_945.length==0){
return true;
}
}
if(!_CF_checknumber(_945)){
return false;
}else{
return (_CF_numberrange((eval(_945)),_946,_947));
}
return true;
};
_CF_checktime=function(_949,_94a){
_949=_949.replace(/^\s+/,"").replace(/\s+$/,"");
_949=_949.replace(/\s+:\s+/,":");
_949=_949=_949.replace(/{t \'/,"").replace(/'}/,"");
if(_94a){
if(_949.length==0){
return false;
}
}else{
if(_949.length==0){
return true;
}
}
var _94b=_CF_checkregex(_949,/^((([0-1]?\d)|(2[0-3])):[0-5]?\d)?(:[0-5]?\d)? ?([AP]M|[AP]m|[ap]m|[ap]M)?$/,_94a);
return _94b;
};
_CF_checkphone=function(_94c,_94d){
_94c=_94c.replace(/^\s+/,"").replace(/\s+$/,"");
if(_94d){
if(_94c.length==0){
return false;
}
}else{
if(_94c.length==0){
return true;
}
}
if(_94c.length==0){
return true;
}
return _CF_checkregex(_94c,/^(((1))?[ ,\-,\.]?([\\(]?([1-9][0-9]{2})[\\)]?))?[ ,\-,\.]?([^0-1]){1}([0-9]){2}[ ,\-,\.]?([0-9]){4}(( )((x){0,1}([0-9]){1,5}){0,1})?$/,_94d);
};
_CF_checkzip=function(_94e,_94f){
_94e=_94e.replace(/^\s+/,"").replace(/\s+$/,"");
if(_94f){
if(_94e.length==0){
return false;
}
}else{
if(_94e.length==0){
return true;
}
}
return _CF_checkregex(_94e,/^([0-9]){5,5}$|(([0-9]){5,5}(-| ){1}([0-9]){4,4}$)/,_94f);
};
_CF_checkcreditcard=function(_950,_951){
_950=_950.replace(/^\s+/,"").replace(/\s+$/,"");
if(_951){
if(_950.length==0){
return false;
}
}else{
if(_950.length==0){
return true;
}
}
if(_950.length==0){
return true;
}
var _952=" -";
var _953="";
var _954;
for(var i=0;i<_950.length;i++){
_954=_952.indexOf(_950.charAt(i));
if(_954<0){
_953+=_950.substring(i,(i+1));
}
}
if(_953.length<13||_953.length>19){
return false;
}
if(_953.charAt(0)=="+"){
return false;
}
if(!_CF_checkinteger(_953)){
return false;
}
var _956=_953.length%2==1?false:true;
var _957=0;
var _958;
for(var i=0;i<_953.length;i++){
_958=eval(_953.charAt(i));
if(_956){
_958*=2;
_957+=(_958%10);
if((_958/10)>=1){
_957++;
}
_956=false;
}else{
_957+=_958;
_956=true;
}
}
return (_957%10)==0?true:false;
};
_CF_checkssn=function(_959,_95a){
_959=_959.replace(/^\s+/,"").replace(/\s+$/,"");
if(_95a){
if(_959.length==0){
return false;
}
}else{
if(_959.length==0){
return true;
}
}
return _CF_checkregex(_959,/^[0-9]{3}(-| )[0-9]{2}(-| )[0-9]{4}$/,_95a);
};
_CF_checkEmail=function(_95b,_95c){
_95b=_95b.replace(/^\s+/,"").replace(/\s+$/,"");
if(_95c){
if(_95b.length==0){
return false;
}
}else{
if(_95b.length==0){
return true;
}
}
return _CF_checkregex(_95b,/^[a-zA-Z_0-9-'\+~]+(\.[a-zA-Z_0-9-'\+~]+)*@([a-zA-Z_0-9-]+\.)+[a-zA-Z]*$/,_95c);
};
_CF_checkURL=function(_95d,_95e){
_95d=_95d.replace(/^\s+/,"").replace(/\s+$/,"");
if(_95e){
if(_95d.length==0){
return false;
}
}else{
if(_95d.length==0){
return true;
}
}
return _CF_checkregex(_95d.toLowerCase(),/^((http|https|ftp|file)\:\/\/([a-zA-Z0-0]*:[a-zA-Z0-0]*(@))?[a-zA-Z0-9-\.]+(\.[a-zA-Z]{2,3})?(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9-\._\?\,\'\/\+&amp;%\$#\=~])*)|((mailto)\:[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]*)|((news)\:[a-zA-Z0-9\.]*)$/,_95e);
};
_CF_checkUUID=function(_95f,_960){
_95f=_95f.replace(/^\s+/,"").replace(/\s+$/,"");
if(_960){
if(_95f.length==0){
return false;
}
}else{
if(_95f.length==0){
return true;
}
}
return _CF_checkregex(_95f,/[A-Fa-f0-9]{8,8}-[A-Fa-f0-9]{4,4}-[A-Fa-f0-9]{4,4}-[A-Fa-f0-9]{16,16}/,_960);
};
_CF_checkGUID=function(_961,_962){
_961=_961.replace(/^\s+/,"").replace(/\s+$/,"");
if(_962){
if(_961.length==0){
return false;
}
}else{
if(_961.length==0){
return true;
}
}
return _CF_checkregex(_961,/[A-Fa-f0-9]{8,8}-[A-Fa-f0-9]{4,4}-[A-Fa-f0-9]{4,4}-[A-Fa-f0-9]{4,4}-[A-Fa-f0-9]{12,12}/,_962);
};
_CF_checkBoolean=function(_963,_964){
_963=_963.replace(/^\s+/,"").replace(/\s+$/,"");
if(_964){
if(_963.length==0){
return false;
}
}else{
if(_963.length==0){
return true;
}
}
if(_963.toUpperCase()=="TRUE"||_963.toUpperCase()=="YES"||(_CF_checknumber(_963)&&_963!="0")){
return true;
}else{
if(_963.toUpperCase()=="FALSE"||_963.toUpperCase()=="NO"||_963=="0"){
return true;
}else{
return false;
}
}
};
_CF_setFormParam=function(_965,_966,_967){
var _968="document['"+_965+"']['"+_966+"']";
var obj=eval(_968);
if(obj==undefined){
return false;
}else{
obj.value=_967;
return true;
}
};
_CF_checkregex=function(_96a,_96b,_96c){
if(_96c){
if(_96a.length==0){
return false;
}
}else{
if(_96a.length==0){
return true;
}
}
return _96b.test(_96a);
};



Please refer to the attachment for what I want (only required the highlighted data.

I am trying to collect Data from 1st July 1997 to 31st December 2022.

Should you have doubt if I have any knowledge of VBA, please refer to the following working code.

Thanking in Advance.


Code:
Sub Get_Web_Data()
 
Dim request As Object
Dim response As String
Dim html As New HTMLDocument
Dim website As String
Dim price As Variant
Dim FstDate As Date
Dim TheDate  As String
Dim r As Long

'String of initial date
FstDate = CDate("1997-07-03")  '<<<<< Edit first date string if required or have entered via an input box?


    For r = 0 To 9400   ' r+2 will fill rows 2 to 9400
    
        TheDate = LCase(Format(FstDate + r, "yyyy%2Fmm%2Fdd"))
        
            website = "https://www.fourmilab.ch/cgi-bin/Solar?date=1&utc=" & TheDate & "+10%3A30%3A00&jd=2476948.34564&img=-k0&sys=-Sf&eyes=0&imgsize=320&orb=-b0&lat=1%B017&ns=North&lon=103%B051&ew=East&hlat=90%B0&hns=North&hlon=0%B0&elements="
            Set request = CreateObject("MSXML2.XMLHTTP")
            request.Open "GET", website, False
            request.send
            response = StrConv(request.responseBody, vbUnicode)
            html.body.innerHTML = response
            price = html.getElementsByTagName("pre")(0).innerText
            Cells(r + 2, "B") = price
    
    Next r
End Sub
 

Attachments

  • Chaos astrology.jpg
    Chaos astrology.jpg
    309.5 KB · Views: 3
Top