Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7124306
D5027.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D5027.diff
View Options
diff --git a/mypy.ini b/mypy.ini
--- a/mypy.ini
+++ b/mypy.ini
@@ -36,6 +36,3 @@
[mypy-urllib3.util.*]
ignore_missing_imports = True
-
-[mypy-xmltodict.*]
-ignore_missing_imports = True
diff --git a/requirements.txt b/requirements.txt
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,6 @@
python_debian
requests
setuptools
-xmltodict
iso8601
beautifulsoup4
launchpadlib
diff --git a/swh/lister/pypi/lister.py b/swh/lister/pypi/lister.py
--- a/swh/lister/pypi/lister.py
+++ b/swh/lister/pypi/lister.py
@@ -6,8 +6,8 @@
import logging
from typing import Iterator, List, Optional
+from bs4 import BeautifulSoup
import requests
-import xmltodict
from swh.scheduler.interface import SchedulerInterface
from swh.scheduler.model import ListedOrigin
@@ -54,8 +54,9 @@
response.raise_for_status()
- page_xmldict = xmltodict.parse(response.content)
- page_results = [p["#text"] for p in page_xmldict["html"]["body"]["a"]]
+ page = BeautifulSoup(response.content, features="html.parser")
+
+ page_results = [p.text for p in page.find_all("a")]
yield page_results
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 21 2024, 6:05 AM (11 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220636
Attached To
D5027: pypi: Use BeautifulSoup for parsing HTML instead of xmltodict
Event Timeline
Log In to Comment