#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import re
import urllib.request
import pandas as pd
import requests
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import os
# timeout:超出时间 等待的最长时间(同时要考虑隐形等待时间)
# 显示等待
driver = webdriver.Chrome()
wait = WebDriverWait(driver, 8)
class MusicInfo(object):
def __init__(self, id, name):
self.id = id
self.name = name
def get_music_info(self):
url = "https://music.163.com/#/artist?id={0}".format(self.id)
driver.get(url)
driver.switch_to.frame('contentFrame')
# with open('data/source.html','w',encoding='utf-8') as f:
# f.write(driver.page_source)
# 获取歌手的姓名,并建立对应文件夹
# a