Skip to content

Commit

Permalink
tests: fix lookup of docs URL
Browse files Browse the repository at this point in the history
  • Loading branch information
algomaster99 committed Oct 20, 2023
1 parent b0dd444 commit 62a1a8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions experimentation/tools/sorald/prmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def get_rule_doc_url(rule_key: int, handled_rules_url: str = HANDLED_RULES_URL)
handled_rules = requests.get(handled_rules_url, headers={"Content-Type": "text/html"}).content.decode()
markup = BeautifulSoup(handled_rules, features="html.parser")

for a_tag in markup.find_all("a", class_="\\\"anchor\\\""):
if f"sonar-rule-{rule_key}" in a_tag.attrs["id"]:
for a_tag in markup.find_all("a"):
if f"sonar-rule-{rule_key}" in a_tag.get("href"):
unescaped_atrr = a_tag.attrs["href"].replace("\\\"", "")
return f"{handled_rules_url}{unescaped_atrr}"

Expand Down

0 comments on commit 62a1a8f

Please sign in to comment.