爬取百度招聘信息

北慕城南 提交于 2020-02-21 18:21:15

我想爬取百度的招聘信息。
我是从https://talent.baidu.com/external/baidu/index.html#/social/2进去
我的程序是这么写的

import urllib
import urllib.request
from bs4 import BeautifulSoup
import json

headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36'}
url = r'https://talent.baidu.com/baidu/web/httpservice/getPostList?postType=&workPlace=0%2F4%2F7%2F9&recruitType=2&keyWord=&pageSize=10&curPage=1&_=1582258750815'
url2 = r'https://talent.baidu.com/external/baidu/index.html#/social/2'

re = urllib.request.Request(url,headers = headers)
info = urllib.request.urlopen(re).read().decode()

# print(info)

soup = BeautifulSoup(info,'lxml')

print(soup.prettify())

但是我得到的信息是这样的
看不到标签和属性
看不到标签和属性,我不是知道怎么去提取信息.
哪一位大神可以帮忙看看!谢谢

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!