猫眼电影票房爬取到MySQL中_猫眼电影爬取(二):requests+beautifulsoup,并将数据存储到mysql数据库...
#coding: utf-8#author: hmkimportrequestsfrom bs4 importBeautifulSoupimport bs4importpymysql.cursorsdefget_html(url, header):try:r= requests.get(url=url, headers=header, timeout=20)r.encoding=r.apparen...