title: extracting data using beautifulsoup from wiki
body: <p>I pretty new to this, </p>
  
  <p><a href="https://i.stack.imgur.com/1GDu4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1GDu4.jpg" alt="enter image description here"></a></p>
  
  <p>What I am trying to accomplished is having a table with distrcits and their various neighborhoods but my final code just list all neighborhoods in a list format without assigning them to a specific district.</p>
  
  <pre><code>url = "https://en.wikipedia.org/wiki/List_of_neighbourhoods_in_Toronto"
  html = urlopen(url) 
  soup = BeautifulSoup(html, 'lxml')
  type(soup)
  print(soup.prettify())
  Toronto_table = soup.find('table',{'class':'wikitable sortable'})
  links = Toronto_table.find_all('a')
  neighborhoods = []
  for link in links:
      neighborhoods.append(link.get('title'))
      print(neighborhoods)
  df_neighborhoods = pd.DataFrame(neighborhoods)
  df_neighborhoods
  </code></pre>