Skip to content

Commit

Permalink
other order try accept
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricdcc committed Sep 13, 2024
1 parent 3454280 commit d8477ce
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,18 @@ def ontopub(baseuri, nsfolder, nssub, nsname, outfolder):

toc_div = soup.find("div", id="toc")
for div in soup.find_all("div", class_="property entity"):
for th in div.find_all("th"):
if th.text == "IRI":
iri = th.find_next("td").find("code").text
previous_id = div["id"]
# find the a href tag in the div with id "toc" and replace the href with the iri.split("#")[1]
for a in toc_div.find_all("a"):
if a["href"] == "#" + previous_id:
try:
try:
for th in div.find_all("th"):
if th.text == "IRI":
iri = th.find_next("td").find("code").text
previous_id = div["id"]
# find the a href tag in the div with id "toc" and replace the href with the iri.split("#")[1]
for a in toc_div.find_all("a"):
if a["href"] == "#" + previous_id:
a["href"] = "#" + iri.split("#")[1]
except:
pass
div["id"] = iri.split("#")[1]
div["id"] = iri.split("#")[1]
except:
pass

# write the soup back to the file
with open(outhtmlpath, "w") as output_html:
Expand Down

0 comments on commit d8477ce

Please sign in to comment.