mirror of
https://codeberg.org/hyperreal/print-wp-sources
synced 2025-01-18 14:23:45 +01:00
Use unquote to decode URLs
This commit is contained in:
parent
a7f0b75a75
commit
9c331dbdda
@ -1,4 +1,5 @@
|
||||
import sys
|
||||
from urllib.parse import unquote
|
||||
from urllib.request import urlopen
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
@ -13,7 +14,7 @@ def main():
|
||||
text = urlopen(url).read()
|
||||
soup = BeautifulSoup(text, "html.parser")
|
||||
for link in soup.find_all("a", attrs={"class": "external text"}):
|
||||
print(link.get("href"))
|
||||
print(unquote(link.get("href")))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "print-wp-sources"
|
||||
version = "0.2"
|
||||
version = "0.3"
|
||||
authors = [
|
||||
{ name="Jeffrey Serio", email="hyperreal@fedoraproject.org" },
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user