<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_moves():
 """Visit Bulbapedia and pull names and descriptions from the table, 'list of moves.' Save as JSON."""

    page = requests.get('http://bulbapedia.bulbagarden.net/wiki/List_of_moves')
    soup = bs4.BeautifulSoup(page.text)
    table = soup.table.table
    tablerows = [tr for tr in table.children if tr != '\n'][1:]

    moves = {}

    for tr in tablerows:
        cells = tr.find_all('td')
        move_name = cells[1].get_text().strip(' \n*').replace(' ', '-').lower()
        move_id = int(cells[0].get_text().strip())
        move_type = cells[2].get_text().strip()
        move_ps = cells[3].get_text().strip()
        moves[move_name] = {'id':move_id, 'type':move_type, 'ps':move_ps}

    srcpath = path.dirname(__file__)
    with io.open(path.join(srcpath, 'moves.json'), 'w', encoding='utf-8') as f:
        f.write(json.dumps(moves, ensure_ascii=False))