aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdtube/dtube.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/dtube/dtube.py b/dtube/dtube.py
index e9de032..1cab0db 100755
--- a/dtube/dtube.py
+++ b/dtube/dtube.py
@@ -179,8 +179,8 @@ class HeIPrange(He):
for i in dns_it.xpath('table/tbody/tr'):
self.dns[i.xpath('td[position()=1]/a/child::text()')[0]] = {
"href": i.xpath('td[position()=1]/a')[0].get('href'),
- "PTR": i.xpath('td[position()=2]/a/child::text()')[0],
- "PTR_href": i.xpath('td[position()=2]/a')[0].get('href'),
+ "PTR": i.xpath('td[position()=2]/a/child::text()')[0] if len(i.xpath('td[position()=2]/a/child::text()')) > 0 else "",
+ "PTR_href": i.xpath('td[position()=2]/a')[0].get('href') if len(i.xpath('td[position()=2]/a')) > 0 else "",
"A_list": i.xpath('td[position()=3]/a/child::text()'),
"A_href_list": [it.get('href') for it in i.xpath('td[position()=3]/a')],
}