Subversion Repositories SmartDukaan

Rev

Rev 18992 | Rev 18996 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18992 Rev 18995
Line 1586... Line 1586...
1586
    tinInfo = {"isError":False}
1586
    tinInfo = {"isError":False}
1587
    try:
1587
    try:
1588
        params = ['tin','cst','counter_name','counter_address','state','pan','registered_on','cst_status','valid_since']
1588
        params = ['tin','cst','counter_name','counter_address','state','pan','registered_on','cst_status','valid_since']
1589
        url  = "http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber=" + tin + "&searchBy=TIN"
1589
        url  = "http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber=" + tin + "&searchBy=TIN"
1590
        req = urllib2.Request(url)
1590
        req = urllib2.Request(url)
-
 
1591
        try:
1591
        connection = urllib2.urlopen(req, timeout=10)
1592
            connection = urllib2.urlopen(req, timeout=10)
-
 
1593
        except:
-
 
1594
            tinInfo = {"isError":True,
-
 
1595
                    "errorMsg": "Some problem occurred. Try again after some time"
-
 
1596
            }
1592
        pageHtml = connection.read()
1597
        pageHtml = connection.read()
1593
        connection.close()        
1598
        connection.close()        
1594
        doc = pq(pageHtml)
1599
        doc = pq(pageHtml)
1595
        index=-1
1600
        index=-1
1596
        for ele in pq(doc.find('table')[2])('tr td:nth-child(2)'):
1601
        for ele in pq(doc.find('table')[2])('tr td:nth-child(2)'):