import requests
from bs4 import BeautifulSoup
import csv
import random
import time
import argparse
from pyecharts.charts import Line
import pandas as pd
class BossCrawler:
def init(self, query):
self.query = query
self.filename = ‘boss_info_%s.csv’ % self.query
self.city_code_list = self.get_city()
self.boss_info_list = []
self.csv_header = [“city”, “profession”, “salary”, “company”]
@staticmethod
def getheaders():
user_list = [
“Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16”,
“Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14”,
“Mozilla/5.0 (Windows NT 6.0; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 12.14”,
“Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0) Opera 12.14”,
“Opera/12.80 (Windows NT 5.1; U; en) Presto/2.10.289 Version/12.02”,
“Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00”,
“Opera/9.80 (Windows NT 5.1; U; zh-sg) Presto/2.9.181 Version/12.00”,
“Opera/12.0(Windows NT 5.2;U;en)Presto/22.9.168 Version/12.00”,
“Opera/12.0(Windows NT 5.1;U;en)Presto/22.9.168 Version/12.00”,
“Mozilla/5.0 (Windows NT 5.1) Gecko/20100101 Firefox/14.0 Opera/12.0”,
“Opera/9.80 (Windows NT 6.1; WOW64; U; pt) Presto/2.10.229 Version/11.62”,
“Opera/9.80 (Windows NT 6.0; U; pl) Presto/2.10.229 Version/11.62”,
“Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52”,
“Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; de) Presto/2.9.168 Version/11.52”,
“Opera/9.80 (Windows NT 5.1; U; en) Presto/2.9.168 Version/11.51”,
“Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; de) Opera 11.51”,
“Opera/9.80 (X11; Linux x86_64;