ValueError exception #1

Closed
opened 2023-06-05 01:23:19 -07:00 by valankar · 7 comments
>>> scha = stockquotes.Stock('SCHA')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/media/sdm1/valankar/software/miniconda3/envs/investing-dev/lib/python3.10/site-packages/stockquotes/__init__.py", line 97, in __init__
    self.increase_dollars = float(
ValueError: could not convert string to float: '(+3.37%)'
>>> scha = stockquotes.Stock('AAPL')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/media/sdm1/valankar/software/miniconda3/envs/investing-dev/lib/python3.10/site-packages/stockquotes/__init__.py", line 97, in __init__
    self.increase_dollars = float(
ValueError: could not convert string to float: '(+0.48%)'
>>>

``` >>> scha = stockquotes.Stock('SCHA') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/media/sdm1/valankar/software/miniconda3/envs/investing-dev/lib/python3.10/site-packages/stockquotes/__init__.py", line 97, in __init__ self.increase_dollars = float( ValueError: could not convert string to float: '(+3.37%)' >>> scha = stockquotes.Stock('AAPL') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/media/sdm1/valankar/software/miniconda3/envs/investing-dev/lib/python3.10/site-packages/stockquotes/__init__.py", line 97, in __init__ self.increase_dollars = float( ValueError: could not convert string to float: '(+0.48%)' >>> ```
Owner

Hello, and thank you for the bug report! I can't reproduce this issue; it works for me. Can you please run this code and send a pastebin link of its output?

import requests

print(
    requests.get(
        "https://finance.yahoo.com/quote/SCHA/history",
        headers={
            "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0"
        },
    ).text
)
Hello, and thank you for the bug report! I can't reproduce this issue; it works for me. Can you please run this code and send a pastebin link of its output? ``` import requests print( requests.get( "https://finance.yahoo.com/quote/SCHA/history", headers={ "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0" }, ).text ) ```
Author

Hi, I've attached the output of that.

Hi, I've attached the output of that.
1.5 MiB
Owner

It's still working with that code. I just realized that the PyPI package, which has been outdated for a couple years, is still online; you probably installed this from there? Maybe you could try installing from the repository?

It's still working with that code. I just realized that the PyPI package, which has been outdated for a couple years, is still online; you probably installed this from there? Maybe you could try installing from the repository?
Author

Yes indeed. It works now, thanks.

Yes indeed. It works now, thanks.
Owner

You're welcome! I'm glad to hear that it's working.

You're welcome! I'm glad to hear that it's working.
Author

Just one question, on:

https://git.kj7rrv.com/kj7rrv/stockquotes

it states to pip from github:

pip3 install git+https://github.com/kj7rrv/stockquotes@stable

Is that still correct?

Just one question, on: https://git.kj7rrv.com/kj7rrv/stockquotes it states to pip from github: `pip3 install git+https://github.com/kj7rrv/stockquotes@stable` Is that still correct?
Owner

Sorry it took a while to answer. That is correct, except the URL is now git.kj7rrv.com rather than github.com. I fixed it in the files; thanks for pointing that out!

Sorry it took a while to answer. That is correct, except the URL is now git.kj7rrv.com rather than github.com. I fixed it in the files; thanks for pointing that out!
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kj7rrv/stockquotes#1
No description provided.