AI4Finance-Foundation / FinGPT

FinGPT: Open-Source Financial Large Language Models! Revolutionize 🔥 We release the trained model on HuggingFace.
https://ai4finance.org
MIT License
13.84k stars 1.92k forks source link

FinGPT-v1 download_contents.py bug modify #17

Closed asmcos closed 1 year ago

asmcos commented 1 year ago

I made two changes:

There was an error in judging the status The content could not be obtained because of the web page revision, and the modification is as follows:

    while not ok:
        try:
            response = requests.get(url = url, headers = headers)
            print(url,response.status_code)
            if response.status_code == 200:
                res = etree.HTML(response.text)
                res = res.xpath("//script[2]//text()")[0]
                res = json.loads(res[17:])
                res = pd.Series(res).to_frame().T
                ok = True
                return res
        except :
            pass
YangletLiu commented 1 year ago

Thanks @asmcos for the modification. Would you like to submit a PR for this?

asmcos commented 1 year ago

I'll try.

oliverwang15 commented 1 year ago

The codes have been updated, Thanks!