This article mainly shares the previous article about how to use Python to obtain market recruitment information, interested friends can refer to this article to share the previous article on how to use Python to obtain market recruitment information. interested friends can refer
This article describes how to obtain information about a website and how to obtain recruitment information from www.net.com. the key code for obtaining recruitment information from www.net.com using python is as follows:
Import reimport urllibimport urllib. request # obtain online data def begin (url): # The Web browser to be disguised as (chrome I use) headers = ('User-agent ', 'mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/80') opener = urllib. request. build_opener () # add the browser to be disguised as the corresponding http header opener. addheaders = [headers] # read the corresponding url data = opener. open (url ). read () # decodes the obtained html to UTF-8 data = data. decode ('utf-8 ') Return data # process the data and return the dictionary City's urldef get_cityinfo (data): city_info1 = re. findall (r'dl> (.*?)', Data, re. s) city_info2 = re. findall (r' () ', city_info1 [0], re. s) city_dict ={}for each in city_info2: key = re. findall ('> (. *?)
(.*?)
', Cdzp_info, re. S) a_dict = {} class_info = re. findall ('
(.*?)
', Allzp_info [0], re. s) for each in class_info: a_info = re. findall (r' () ', each, re. s) for each1 in a_info: key = re. findall ('> (. *?)
The above is all the content of this article, hoping to help you learn.
For more Python methods for obtaining market recruitment information, please follow the PHP Chinese network!