Skip to content

Commit c7a4e60

Browse files
yucufacebook-github-bot
authored andcommitted
parse_tutorials update (#1268)
Summary: Pull Request resolved: #1268 In `gen_tutorials`, `nb_meat` fectched by `soup.find("div", {"id": "notebook-container"})` doesn't always exists. Add extra handling for such case. Reviewed By: vivekmig Differential Revision: D55665385 fbshipit-source-id: f450cce67d413229f64b3d064bcde5aac535d4be
1 parent 3963723 commit c7a4e60

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/parse_tutorials.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ def gen_tutorials(repo_dir: str) -> None:
7171
# pull out html div for notebook
7272
soup = BeautifulSoup(html, "html.parser")
7373
nb_meat = soup.find("div", {"id": "notebook-container"})
74-
del nb_meat.attrs["id"]
75-
nb_meat.attrs["class"] = ["notebook"]
74+
if nb_meat:
75+
del nb_meat.attrs["id"]
76+
nb_meat.attrs["class"] = ["notebook"]
7677
html_out = JS_SCRIPTS + str(nb_meat)
7778

7879
# generate html file

0 commit comments

Comments
 (0)