-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-html-objects.el
31 lines (29 loc) · 1.1 KB
/
get-html-objects.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;; -*- lexical-binding: t; -*-
(defun yaoni/get-html-text (buffer-name)
(interactive)
(let* ((text (progn
(with-current-buffer buffer-name
(dom-texts (libxml-parse-html-region (point-min) (point-max)) "\n")))
))
(with-current-buffer
(get-buffer-create "*output*")
(erase-buffer)
(insert text))))
(defun yaoni/get-html-headings (buffer-name)
(let* ((text (progn
(with-current-buffer buffer-name
(mapconcat 'dom-texts (dom-by-tag (libxml-parse-html-region (point-min) (point-max)) 'code) "\n")))
))
(with-current-buffer
(get-buffer-create "*output-headings*")
(erase-buffer)
(insert text))))
(defun yaoni/get-html-subheadings (buffer-name)
(let* ((text (progn
(with-current-buffer buffer-name
(mapconcat 'dom-texts (dom-by-tag (libxml-parse-html-region (point-min) (point-max)) 'strong) "\n")))
))
(with-current-buffer
(get-buffer-create "*output-headings*")
(erase-buffer)
(insert text))))