return null on page not existing

main
Brett 2023-12-22 12:32:17 -05:00
parent 0b8e1bde7c
commit b4cc93e133
1 changed files with 4 additions and 0 deletions

View File

@ -174,6 +174,10 @@ def process_page(url):
soup = open_url(url) soup = open_url(url)
ref = soup.find("div", class_="refentry") ref = soup.find("div", class_="refentry")
if ref is None:
print("NULL")
return
name_div = ref.find("div", class_="refnamediv") name_div = ref.find("div", class_="refnamediv")
cspec_div = ref.find("div", class_="refsynopsisdiv").find("div", class_="funcsynopsis") cspec_div = ref.find("div", class_="refsynopsisdiv").find("div", class_="funcsynopsis")
parameters_div = ref.find("div", id="parameters") parameters_div = ref.find("div", id="parameters")