Skip to content

can't fetch data from CHINA stock api #10

Description

@lvscar

While US stock api work well, I can't fetch data from CHINA stock api. The error message in my Message buffer is :

gnutls.el: (err=[-54] Error in the pull function.) boot: (:priority NORMAL:%DUMBFW :hostname api.money.126.net :loglevel 0 :min-prime-bits nil :trustfiles (/etc/ssl/cert.pem) :crlfiles nil :keylist nil :verify-flags nil :verify-error nil :pass nil :flags nil :callbacks nil)

I have opened ^toggle-debug-on-error , bug still can't see more debug information.

My environment is:

  • OS: MacOS 14.7.4
  • Emacs 30.1

I have written a simple function to test url-retrieve-synchronously which you used in stock-tracker.el in my environment, found it download the HTML file of https://money.163.com/stock without problem.

`
(defun download-data-from-url (url)
"Download data from the specified URL and return the response body."
(let ((url-buffer (url-retrieve-synchronously url)))
(if url-buffer
(with-current-buffer url-buffer
;; Skip the HTTP headers
(goto-char (point-min))
(re-search-forward "^$") ; Find the end of the headers
(delete-region (point) (point-min)) ; Delete headers
(buffer-string)) ; Return the response body as a string
(error "Failed to retrieve data from URL: %s" url))))

(download-data-from-url "https://money.163.com/stock/") ;; no problem
`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions