diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2013-03-10 00:27:13 +0100 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2013-03-10 00:27:13 +0100 |
commit | 6c26405d87c5656097f9290bff9fb66e68f810b3 (patch) | |
tree | 2f56026dc5a5f209bcc73d2d62980a6a004e668d | |
parent | conf: rename bashrc (diff) | |
download | laurent-tools-6c26405d87c5656097f9290bff9fb66e68f810b3.tar.xz laurent-tools-6c26405d87c5656097f9290bff9fb66e68f810b3.zip |
dtube: handle IPrange DNS with empty PTR
Diffstat (limited to '')
-rwxr-xr-x | dtube/dtube.py | 4 |
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')], } |