python爬虫实战-爬取岗位招聘信息并保存至本地(方法,bs4)
from bs4 import BeautifulSoup
import urllib.request
import urllib.parse
import json
import time
class ZhiLianSpider(object):
"""docstring for ZhiLianSpider"""
url='https://xiaoyuan.zhaopin.com/full/0/0_0_0_0_0_-1_'
# https://xiaoyuan.zhaopin.com/full/0/0_0_0_0_0_-1_%E8%A5%BF%E5%AE%89_3_0
def __init__(self, kw,start_page,end_page):
super(ZhiLianSpider, self).__init__()
self.kw=kw
self.start_page=start_page
self.end_page=end_page
self.items=[]
def parse_content(self,content):
soup=BeautifulSoup(content,'lxml')<