Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyerror 'href' #6

Open
pietermj opened this issue Jul 9, 2022 · 0 comments
Open

keyerror 'href' #6

pietermj opened this issue Jul 9, 2022 · 0 comments

Comments

@pietermj
Copy link

pietermj commented Jul 9, 2022

Each time I receive a key error "href" in my favorites on the Ask HN; Any Decent Firefox Alternatives item:

Saving Android phones are sending significant amount of user data with no opt-out [pdf]...
Saving Ask HN: Any Decent Firefox Alternatives?...
Traceback (most recent call last):
File "c:\program files (x86)\python39-32\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files (x86)\python39-32\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\username\AppData\Roaming\Python\Python39\Scripts\archivy.exe_main
.py", line 7, in
File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\flask\cli.py", line 596, in main
return super().main(*args, **kwargs)
File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\click\core.py", line 760, in invoke
return _callback(*args, **kwargs)
File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\archivy_hn_init
.py", line 132, in hn_sync
post_url = post_links[j]["href"]
File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\bs4\element.py", line 1519, in getitem
return self.attrs[key]
KeyError: 'href'
I also leave in the previous save, it's an hn item that refers to a pdf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant