From 25415e342c7644bbe17e4e721ff984adaa40b605 Mon Sep 17 00:00:00 2001 From: guest20 Date: Wed, 17 Jun 2026 13:20:29 +0200 Subject: [PATCH] robots.py: div class=description --- code/robots.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/code/robots.py b/code/robots.py index 12847a0..2479c51 100755 --- a/code/robots.py +++ b/code/robots.py @@ -56,13 +56,9 @@ def updated_robots_json(soup): name = agent.find("div", {"class": "agent-name"}).get_text().strip() name = clean_robot_name(name) - # This line below occasionally throws this error: AttributeError: 'NoneType' object has no attribute 'get_text' - #desc = agent.find("p").get_text().strip() - - # Attempting a different way to handle to avoid errors: - p_tag = agent.find("p") - if p_tag is not None: - desc = p_tag.get_text().strip() + desc_tag = agent.find("div", {"class": "description"}) + if desc_tag is not None: + desc = desc_tag.get_text().strip() else: desc = "Description unavailable from darkvisitors.com"