ValueError exception #1

Closed
opened 11 months ago 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 ) ```
Poster

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?
Poster

Yes indeed. It works now, thanks.

Yes indeed. It works now, thanks.
valankar closed this issue 11 months ago
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.
Poster

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

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.