(require 'w3m-form) (require 'time-my) (defun web-login () (interactive) (let ((m 7) ; anchor for login name (n 8) ; anchor for password (name (symbol-function 'login-name)) (pass (symbol-function 'login-pass)) (anchor (point-min)) action) ;; goto the m-th anchor (while (and (setq anchor (text-property-not-all anchor (point-max) 'w3m-anchor-sequence nil)) (> (setq m (1- m)) 0) (setq anchor (text-property-any anchor (point-max) 'w3m-anchor-sequence nil)))) (goto-char anchor) ;; enter login name (setq action (w3m-action)) (w3m-form-put (nth 1 action) (nth 2 action) (nth 3 action) name) (w3m-form-replace name) ;; goto the n-th anchor (setq anchor (point-min)) (while (and (setq anchor (text-property-not-all anchor (point-max) 'w3m-anchor-sequence nil)) (> (setq n (1- n)) 0) (setq anchor (text-property-any anchor (point-max) 'w3m-anchor-sequence nil)))) (goto-char anchor) ;; enter password (setq action (w3m-action)) (w3m-form-put (nth 1 action) (nth 2 action) (nth 3 action) pass) (w3m-form-replace pass 'invisible) ;; submit it (eval (w3m-submit)))) (defalias 'wl 'web-login)