[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get the inner html of a href link.
- From: netawater <standin-000@xxxxxxxxx>
- Date: Sat, 14 Mar 2009 10:32:54 +0800
- X-ml-name: emacs-w3m
- X-mail-count: 10770
- References: <87ocw9mrfa.fsf@xxxxxxxxxxxxxx> <b4mwsaw4zuv.fsf@xxxxxxx> <87r614taw6.fsf@xxxxxxxxxxxxxx> <b4mk56vptrg.fsf@xxxxxxx>
Katsumi Yamaoka <yamaoka@xxxxxxx> writes:
>>>>>> In [emacs-w3m : No.10759] netawater wrote:
>> Katsumi Yamaoka <yamaoka@xxxxxxx> writes:
>>> (defun my-w3m-href-text (&optional position)
> [...]
>
>> Thank you very much! It works well.
>
>> however it seems it is not easy to get html attribute in w3m which
>> does not implement DOM, is it?
>
> The `w3m-parse-attributes' macro, used here and there in emacs-w3m,
> is it. This extracts KEYWORD="VALUE" attributes within a tag:
>
> (w3m-parse-attributes (KEYWORD [KEYWORD...])
> (Lisp forms that use KEYWORDs))
>
> KEYWORD can be (KEYWORD TYPE), where TYPE is one of `:case-ignore',
> `:integer', `:bool', and `:decode-entity'. For example:
>
> (with-temp-buffer
> (insert "<a href=\"http://www.example.com\"\
> fOo=\"FoO-vAlUe\"\
> BaR=\"bAr-VaLuE\">\n")
> (goto-char 2)
> (w3m-parse-attributes (foo (bar :case-ignore))
> (list foo bar)))
> => ("FoO-vAlUe" "bar-value")
>
> The point has to be within the tag, and only attributes that follow
> the point will be extracted.
Thank you for your reply but I tried run these function, it returns
(nil nil). I use GNU emacs 22.2.1 and w3m-0.5.2.