diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2013-02-28 12:13:43 +0100 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2013-02-28 12:13:43 +0100 |
commit | 7fca37d33732ab3c1796707a67bef649ec9e9491 (patch) | |
tree | 7432d75c2803642653a180c77ddf71c383bceba9 | |
parent | TODO++ (diff) | |
download | laurent-tools-7fca37d33732ab3c1796707a67bef649ec9e9491.tar.xz laurent-tools-7fca37d33732ab3c1796707a67bef649ec9e9491.zip |
dtube: fix bug if no country in IPrange of AS
-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 5dd7735..8b440b4 100755 --- a/dtube/dtube.py +++ b/dtube/dtube.py @@ -139,13 +139,13 @@ class HeAS(He): self.prefixes[p.xpath('td/a/child::text()')[0]] = { "href": p.xpath('td/a')[0].get('href'), "description": p.xpath('td[position()=2]/child::text()')[0].strip(), - "country": p.xpath('td/div/img')[0].get('title'), + "country": p.xpath('td/div/img')[0].get('title') if p.xpath('td/div/img') else None, } self.prefixes_txt = "" for p in self.prefixes.keys(): self.prefixes_txt += p \ + '\t' + self.prefixes[p]["description"] \ - + '\t(' + self.prefixes[p]["country"] + ')' + '\n' + + '\t(' + str(self.prefixes[p]["country"]) + ')' + '\n' # XXX Peers # XXX Whois # XXX IRR |