'KARLAPUDI ROSAIAH, EEDA ANJI REDDY LAND'
делится на два, т.к. содержит запятую. s = response.xpath("//td[@class = 'formbg1']/a/@onclick").extract()[0].split('Data')[1][1:-1].replace("'","").split(',')
def make_requests():
response = [None]
if(request_www_cmc_gov_co_8080(response)):
response[0].close()
def request_www_cmc_gov_co_8080(response):
response[0] = None
try:
req = urllib.request.Request("http://www.cmc.gov.co:8080/CmcFrontEnd/consulta/detalleExpedienteTitulo.cmc")
req.add_header("Connection", "keep-alive")
req.add_header("Cache-Control", "max-age=0")
req.add_header("Upgrade-Insecure-Requests", "1")
req.add_header("User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36")
req.add_header("DNT", "1")
req.add_header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
req.add_header("Referer", "http://www.cmc.gov.co:8080/CmcFrontEnd/consulta/busqueda.cmc")
req.add_header("Accept-Encoding", "gzip, deflate")
req.add_header("Accept-Language", "en-US,en;q=0.9,ru;q=0.8,uk;q=0.7")
req.add_header("Cookie", "PHPSESSID=2ba8dsre6l42un95qu33k09ud6")
response[0] = urllib.request.urlopen(req)
except urllib.error.URLError as e:
if not hasattr(e, "code"):
return False
response[0] = e
except:
return False
return True