JavaScript Web crawler encounter javascript

I'm new to web crawling. I am trying to crawl a webpage using java and I encounter a problem. I need to get the link in a 'HTML Tag' whose href is a javascript function. I have no idea how to get the link in the javascript function. Here is the html source and javascript source.

HTML

<a target='_blank' href='javascript:ShowPostGridUnique(205316,0);'>link</a>

JSShowPostGridUnique

function ShowPostGridUnique(parentpostid, pageShow) {
    //alert(parentpostid);
    var divid;
    divid = 'divPostContent' + parentpostid;
    if (document.getElementById(divid).className == 'divGridShow') {
        document.getElementById(divid).className = 'divGridHide';
        document.getElementById(divid).innerHTML = '';
    }
    else {
        document.getElementById(divid).className = 'divGridShow';
        // call server side method
        PageMethods.divParentInnerHtml( parentpostid, pageShow, CallSuccessShowPost, CallFailedAlert, parentpostid);
        try {
            divid = 'TDtitle' + parentpostid;
            document.getElementById(divid).className = 'TDtitle';
            divid = 'TDPage' + parentpostid;
            document.getElementById(divid).className = 'TDtitle';
        }
        catch (err) {
            //Handle errors here
        }
    }
}

How can i get the link of href? Thanks.

Answer:1

Hi I have created a dom using raw javascript DOM: Javascript code: var parentElm = document.createElement("div"); var child1 = document.createElement("p"); var child2 = document.createElement("p"); ...

Hi I have created a dom using raw javascript DOM: Javascript code: var parentElm = document.createElement("div"); var child1 = document.createElement("p"); var child2 = document.createElement("p"); ...

I am creating dynatree. I want to set first node of dynatree to be selected on opening dynatree. I set select= tree in json for first element. but it does't work. I want to skip adding select property ...

I am creating dynatree. I want to set first node of dynatree to be selected on opening dynatree. I set select= tree in json for first element. but it does't work. I want to skip adding select property ...

  1. dynatree select first node

So I'm working on a gallery where images are shown in a 200x200px list item #gallery-list-ui li { display: block; margin: 10px; height: 200px; width: 200px; overflow: hidden; } ...

So I'm working on a gallery where images are shown in a 200x200px list item #gallery-list-ui li { display: block; margin: 10px; height: 200px; width: 200px; overflow: hidden; } ...

  1. isn't
  2. https://www.instagram.com/
  3. isnetworld
  4. instagram
  5. isn't she lovely
  6. isnt it romantic
  7. isna
  8. isn't it ironic
  9. isner
  10. isnull sql
  11. isn network
  12. isnac 2020
  13. isnt she lovely chords
  14. isns
  15. isnan
  16. isn't it
  17. isnull
  18. isn't it romantic cast
  19. isna excel
  20. disney plus

var data = [ { cid: "59eb15be", parentCid: "", lv: 1, number: "2", subject: "Title 2" }, { cid: "d7d851ef", parentCid: "", lv: 1, number: "4", ...

var data = [ { cid: "59eb15be", parentCid: "", lv: 1, number: "2", subject: "Title 2" }, { cid: "d7d851ef", parentCid: "", lv: 1, number: "4", ...

  1. sort json data by value
  2. sort json data python
  3. sort json data alphabetically
  4. sort json data in javascript
  5. sort json data in react
  6. sort json data online
  7. sort json data by value python
  8. sort json data in angular
  9. sort json data by key
  10. sort json data by date
  11. sort json data
  12. sort json data using javascript
  13. sort json data in jquery
  14. sort json data php
  15. sort json data in angularjs
  16. sort json data java
  17. sort json data js
  18. sort json data c#
  19. sort json data in angular 6
  20. sort json data using jquery