I want to parse mail from the site, but the script for some reason gives an empty list 
code
all_links = [] def get_links(): try: page = requests.get(url) tree = html.fromstring(page.content) links = tree.xpath('//h2[@itemprop="name"]/a') for lnk in links: all_links.append('https://www.ua-region.info{}'.format(lnk.get('href'))) print('https://www.ua-region.info{}'.format(lnk.get('href'))) except Exception as e: print(e) for url in all_pages: get_links() print('{} links found'.format(len(all_links))) mails = [] **def get_mail(): try: mail = [i.text.encode('utf-8') for i in tree.xpath('//td[@itemprop="email"]/a')] print(mail) except Exception as e: print(e) print('mail not found') mails.append('')** What needs to be fixed?
full code https://pastebin.com/Tkg8egtP

get_links()function, but there is no function itself. The problem is in her. And the link to pastebin does not have this function either. - insolor