i m new using jsoup library (jsoup-1.14.3)
i have this html
<html><head><title>Alfresco Content Repository</title><style>body { font-family: Arial, Helvetica; font-size: 12pt; background-color: white; }
table { font-family: Arial, Helvetica; font-size: 12pt; background-color: white; }
.listingTable { border: solid black 1px; }
.textCommand { font-family: verdana; font-size: 10pt; }
.textLocation { font-family: verdana; font-size: 11pt; font-weight: bold; color: #2a568f; }
.textData { font-family: verdana; font-size: 10pt; }
.tableHeading { font-family: verdana; font-size: 10pt; font-weight: bold; color: white; background-color: #2a568f; }
.rowOdd { background-color: #eeeeee; }
.rowEven { background-color: #dddddd; }
</style></head>
<body>
<table cellspacing='2' cellpadding='3' border='0' width='100%'>
<tr><td colspan='4' class='textLocation'>Directory listing for /rep</td></tr>
<tr><td height='10' colspan='4'></td></tr></table><table cellspacing='2' cellpadding='3' border='0' width='100%' class='listingTable'>
<tr><td class='tableHeading' width='*'>Name</td><td class='tableHeading' width='10%'>Size</td><td class='tableHeading' width='20%'>Type</td><td class='tableHeading' width='25%'>Modified Date</td></tr>
<tr class='rowOdd'><td class='textData'><a href="/alfresco/webdav/rep/ED">ED</a></td><td class='textData'> </td><td class='textData'> </td><td class='textData'>Thu, 05 Jan 2017 11:11:14 GMT</td></tr>
<tr class='rowEven'><td class='textData'><a href="/alfresco/webdav/rep/FLOW%20CHART">FLOW CHART</a></td><td class='textData'> </td><td class='textData'> </td><td class='textData'>Thu, 27 Jun 2013 13:30:18 GMT</td></tr>
<tr class='rowOdd'><td class='textData'><a href="/alfresco/webdav/rep/file">file</a></td><td class='textData'> </td><td class='textData'> </td><td class='textData'>Wed, 10 Nov 2021 13:16:49 GMT</td></tr>
</table></body></html>
ANd , i'm trying to get the href of each tag .
For example ,
<table cellspacing='2' cellpadding='3' border='0' width='100%'>
<tr><td colspan='4' class='textLocation'>Directory listing for /rep</td></tr>
<tr><td height='10' colspan='4'></td></tr></table><table cellspacing='2' cellpadding='3' border='0' width='100%' class='listingTable'>
<tr><td class='tableHeading' width='*'>Name</td><td class='tableHeading' width='10%'>Size</td><td class='tableHeading' width='20%'>Type</td><td class='tableHeading' width='25%'>Modified Date</td></tr>
<tr class='rowOdd'><td class='textData'><a href="/alfresco/webdav/rep/ED">ED</a></td><td class='textData'> </td><td class='textData'> </td><td class='textData'>Thu, 05 Jan 2017 11:11:14 GMT</td></tr>
I want to extract "/alfresco/webdav/rep/ED" and "ED" and "Thu, 05 Jan 2017 11:11:14 GMT"
ahref. Also, you should get element, you can use lot of things such asdocument.getElementByIdtextDataor all hrefs all together, the answer will depend on which hrefs you want to select and it's not clear from the questionhref. Why don't you handle all three?Thu, 05 Jan 2017 11:11:14 GMThas nothing to do with the attributehref. How do you identify it?