Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Update scraping logic to keep up with GitHub UI (#309)

Dhruv Bhanushali0b5e24bd325d
diff --git a/automations/python/label_pr.py b/automations/python/label_pr.py
index 27d0157bd..9c8b8f129 100644
--- a/automations/python/label_pr.py
+++ b/automations/python/label_pr.py
@@ -128,9 +128,10 @@ def get_linked_issues(url: str) -> list[str]:
return []
soup = BeautifulSoup(text, "html.parser")
- divs = soup.find_all("div", **{"class": re.compile("css-truncate my-1")})
- anchors = [div.a["href"] for div in divs]
- return anchors
+ form = soup.find("form", **{"aria-label": "Link issues"})
+ if form is None:
+ return []
+ return [a["href"] for a in form.find_all("a")]
def get_label_of_cat(cat: str, labels: list[Label]) -> Optional[Label]: