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
|
import sys
|
||||||
|
from urllib.parse import unquote
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
@ -13,7 +14,7 @@ def main():
|
|||||||
text = urlopen(url).read()
|
text = urlopen(url).read()
|
||||||
soup = BeautifulSoup(text, "html.parser")
|
soup = BeautifulSoup(text, "html.parser")
|
||||||
for link in soup.find_all("a", attrs={"class": "external text"}):
|
for link in soup.find_all("a", attrs={"class": "external text"}):
|
||||||
print(link.get("href"))
|
print(unquote(link.get("href")))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "print-wp-sources"
|
name = "print-wp-sources"
|
||||||
version = "0.2"
|
version = "0.3"
|
||||||
authors = [
|
authors = [
|
||||||
{ name="Jeffrey Serio", email="hyperreal@fedoraproject.org" },
|
{ name="Jeffrey Serio", email="hyperreal@fedoraproject.org" },
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user