javascript - Android: get link from HTML-code (no tag/id) -
i want download ical file app.
works fine, link file change every 6 months.
the page/link inherits link file not change, want code of main page , find link ical file download it.
i think may work best javascript, have no clue that. there no tag or id search for.
this page search link:
https://stundenplan.hs-furtwangen.de/splan/std?act=tt&lan=de&pu=-1&sel=pg&og=1433&pg=cnb4
the search pattern "/splan/ical"
there found link file.
in end need "/splan/ical?type=pg&puid=6&pgid=1617&lan=de"
stored somewhere.
right use downloadmanager
file, no html-code stored anywhere.
hope can help. thanks.
edit:
here part of html source contains link (first href):
<tr> <td /> <td colspan="1"><a href="/splan/ical?type=pg&puid=8&pgid=2505&lan=de"><img style="align: middle; border: 0;" src="/splan/pictures/ical.png" alt="ics feed" height="20" /></a> <a href="http://www.progotec.de/site/splandok/ical-anbindung" target="_blank"><img style="align: middle; border: 0;" alt="hilfe zu ical" src="/splan/pictures/hilfe.png" title="hilfe zu ical" height="20" /></a> </td> </tr>
i not sure looking for, javscript-script can find link.
//like link on page //search done regularexpression alert(document.body.innerhtml.match(/(\/splan\/ical[^"]*)/gi));
<body> <!-- have body of page --> ... <a href="/splan/ical?type=pg&puid=8&pgid=2505&lan=de"><img style="align: middle; border: 0;" src="/splan/pictures/ical.png" alt="ics feed" height="20" /></a> ... </body>
here regex demo on whole stundenplan.hs-furtwangen.de: http://regex101.com/r/wf3wu4/1
Comments
Post a Comment