Giter Site home page Giter Site logo

Comments (3)

shenjian74 avatar shenjian74 commented on May 22, 2024 1

在import akshare时,会自动到sina上GET网页。
问题是这个时候使用者并不想浪费时间去下载资源,可能网络也不通,有什么方法可以禁止这个下载动作吗?

from akshare.

albertandking avatar albertandking commented on May 22, 2024

File "d:\repo\stock-price-data\akshare\test.py", line 4, in
import akshare as ak
File "C:\ProgramData\Miniconda3\lib\site-packages\akshare__init__.py", line 1009, in
from akshare.futures.futures_foreign import futures_foreign_detail, futures_foreign_hist
File "C:\ProgramData\Miniconda3\lib\site-packages\akshare\futures\futures_foreign.py", line 15, in
from akshare.futures.hf_futures_sina import hf_subscribe_exchange_symbol
File "C:\ProgramData\Miniconda3\lib\site-packages\akshare\futures\hf_futures_sina.py", line 53, in
def futures_hf_spot(subscribe_list=hf_subscribe_exchange_symbol()):
File "C:\ProgramData\Miniconda3\lib\site-packages\akshare\futures\hf_futures_sina.py", line 48, in hf_subscribe_exchange_symbol
res.text[res.text.find("var oHF_1 = ") + 12: res.text.find("var oHF_2 = ") - 2]
File "C:\ProgramData\Miniconda3\lib\site-packages\demjson.py", line 5699, in decode
return_stats=(return_stats or write_stats) )
File "C:\ProgramData\Miniconda3\lib\site-packages\demjson.py", line 4915, in decode
raise errors[0]
demjson.JSONDecodeError: ('Unknown identifier', 'tml')

哈罗,看代码问题应该是在 d:\repo\stock-price-data\akshare\test.py 里面的名字 akshare 最好换其他命名,初始化阶段只是加载对应函数

from akshare.

albertandking avatar albertandking commented on May 22, 2024

在import akshare时,会自动到sina上GET网页。
问题是这个时候使用者并不想浪费时间去下载资源,可能网络也不通,有什么方法可以禁止这个下载动作吗?

谢谢,我通过在无网络环境下 import akshare 确实会引起访问新浪加载数据的问题,因为在一个函数初始化的时候调用引起的,目前在 akshare 0.5.7 版本已经修复该问题
再次感谢你的 issues,我之前的测试没用发现这个bug

from akshare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.