I need to kill and yank some portion of the source code of multiples websites for a database i'm making of news of certain web. But the problem is, whenever i call
eww-view-source for viewing the website's source, it gives me an error of "no source".
The function and macro (I made a keyboard macro when the function didn't work) works the first time, but at a second execution it gives me the error.
I'm using an
.org file with all the links i need to access and copy a portion from their source. This region is determined with two
search-forward expressions. This is the function i made (ignore the name and description, i'm from Latinoamérica):
(defun aporrea-listar-archivo () "Copia en la entrada el código relativo a las noticias de una página del archivo de aporrea." (interactive) (save-excursion (org-open-at-point) (set-buffer "*eww*") ;;added this trying to solve (eww-view-source) (set-buffer "*eww-source*") ;;added this trying to solve (copy-region-as-kill (search-forward "<h1>Noticias</h1>") (search-forward "<h1>Artículos de Opinión</h1>")) (View-quit) ;; This exits the view-mode of eww for sources (kill-buffer "*eww-source*") (kill-buffer "*eww*")))
For some reason the
save-excursion is not working. I'm ok with that...