import requests, re, json, os, time from fake_useragent import UserAgent from lxml import etree from urllib import parse class MyError(Exception): def __init__(self, status, msg): self.status = status self.msg = msg class WyRinking(): def __init__(se
接触python也有一段时间了,一提到python,可能大部分pythoner都会想到爬虫,没错,今天我们的话题就是爬虫!作为一个小学生,关于爬虫其实本人也只是略懂,怀着"Done is better than perfect"的态度硬着头皮开始了这篇文章的撰写!好了,废话不多说! 先说一下今天我们的目的,作为一个音痴但不影响我对于音乐的执着,所以今天我们爬取的是网易云音乐,我们将会通过代码爬取歌词并写入到本地. 作为新手,我很本能就打开页面复制了url,然后用Beautifulsou