🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    HowTo/LeaveItToJS/PageProcessing.js
    skipped 95 lines
    96 96   "/div/div/div[2]/a/div/section/div[2]/div/p[1]",
    97 97   "/div/div/div[2]/div/section/div/div/a/p[1]",
    98 98   "/div/div/div[2]/a/div/section/div[2]/div/h4",
    99  - "/div/div/div[2]/div/section/div/div/p"
     99 + "/div/div/div[2]/div/section/div/div/p",
     100 + "/div/div/div[2]/a/div/section/div[2]/div/h2"
    100 101   ];
    101 102   a_xpath = wrt_xpath + "/div/div/div[2]/a";
    102 103   date_xpath = wrt_xpath + "/div/div/div[1]/div/div/div[2]/div/a";
    103 104  
    104 105   name_el = null;
    105 106   for (let i=0; i<name_xpaths.length; i++) {
    106  - console.log(i);
     107 + console.log(wrt_xpath + " : " + i);
    107 108   name_el = GetElementByXpath(wrt_xpath + name_xpaths[i]);
    108 109   if (name_el != null)
    109 110   break;
    110 111   }
    111 112   
    112  - name = name_el.textContent;
    113  - link = GetElementByXpath(a_xpath).href.split("?")[0];
    114  - date = GetElementByXpath(date_xpath).text;
     113 + if (name_el == null) {
     114 + name = "ERROR";
     115 + date = wrt_xpath;
     116 + link = window.location.href;
     117 + }
     118 + else {
     119 + name = name_el.textContent;
     120 + link = GetElementByXpath(a_xpath).href.split("?")[0];
     121 + date = GetElementByXpath(date_xpath).text;
     122 + }
    115 123  
    116 124   return {name:name, date:date, link:link};
    117 125  }
    skipped 74 lines
Please wait...
Page is in error, reload to recover