title: Selenium with webdriver error & printing null in NoneType case
body: <p>I want to crowling in a bank site but google chrome driver doesn't work.
  And I want to print as 'null' if the type is 'NoneType' 
  I wrote this code in jupyter notebook(anaconda3).</p>
  
  <p>I tried to solve this problem using 'if...else...'</p>
  
  <pre><code>from bs4 import BeautifulSoup
  
  from urllib.request import urlopen
  
  from selenium import webdriver 
  
  driver = webdriver.Chrome('./chromedriver.exe') html_dr = driver.execute_script('return document.body.innerHTML') #question
  
  url_base = 'https://www.kebhana.com/cont/mall/mall08/mall0805/index.jsp?_menuNo=62608'
  
  html = urlopen(url_base) soup = BeautifulSoup(html, "html.parser")
  
  soup
  
  print(soup.find_all('li', 'item type1'))
  
  len(soup.find_all('li', 'item type1'))
  
  from urllib.request import urljoin
  
  name = [] url_add = [] period = [] strong = [] term = []
  
  list_soup = soup.find_all('li', 'item type1')
  
  for item in list_soup: name.append(item.find('a').get_text()) url_add.append(urljoin(url_base, item.find('a')['href'])) #question # # #'NoneType' object has no attribute 'get_text' #if item is not None: #period.append(item.find(class_='period').get_text()) #strong.append(item.find('strong')) #term.append(item.find(class_='term')) #else: #print("null")
  
  url_add[:5]
  
  name[:5]
  
  period[:23]
  
  strong[:23]
  
  import pandas as pd
  
  data = {'Name':name, 'URL':url_add} df = pd.DataFrame(data) df.head() df.to_csv('./hana_list.csv', sep=',', encoding='EUC-KR')
  
  df['URL'][0]
  
  html = urlopen(df['URL'][0]) soup_tmp = BeautifulSoup(html, "html.parser") soup_tmp
  
  print(soup_tmp.find('dl', 'prodcutInfo'))
  
  print(soup_tmp.find('div', 'exist_table'))
  
  print(soup_tmp.find(class_='tbl_tbldiv'))
  </code></pre>
  
  <p>'NoneType' object has no attribute 'get_text'</p>