<a href="?action=add&question=149&cat=88">Answer</a>'
this is the url i needed to get href value i cannot use element.getAttribute. I cannot use dom parsing.
But if i try to parse it using search mechanism
td3_element = <td valign="top">
<a href="?action=add&question=149&cat=88">Answer</a>
</td>
href_start = td3_element.search("<a href=") + 8;
td3_part = td3_element.substring(href_start);
href_end = td3_part.search(">Answer</a>");
href_element = td3_part.substring(0,href_end);
href_element will only be till `?action=addamp`
it is taking the
;
character coming after amp as end of line and it is terminating search to that point. Can some one tell me a solution which will give the desired href without using DOM parser
Have you tried a regular expression? I’m not sure what you mean just by ‘search mechanism’.
For example:
See also this jsfiddle