Skip to content

No longer works #24

@vadim0x60

Description

@vadim0x60

In 2021 this package always fails to import things with the following error:

  File "/home/vadim0x60/.pyenv/versions/3.9.9/lib/python3.9/site-packages/stackoverflow/__init__.py", line 34, in find_spec
    code, author, url = cls.find_working_code(spec.name)
  File "/home/vadim0x60/.pyenv/versions/3.9.9/lib/python3.9/site-packages/stackoverflow/__init__.py", line 24, in find_working_code
    result = cls.fetch_code(url)
  File "/home/vadim0x60/.pyenv/versions/3.9.9/lib/python3.9/site-packages/stackoverflow/__init__.py", line 85, in fetch_code
    return cls.find_code_in_html(q.text)
  File "/home/vadim0x60/.pyenv/versions/3.9.9/lib/python3.9/site-packages/stackoverflow/__init__.py", line 94, in find_code_in_html
    answer.votes = int(answer.find(itemprop="upvoteCount")["data-value"])
TypeError: 'NoneType' object is not subscriptable

Tragic to see an essential part of my workflow completely fail me.

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