博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python爬虫
阅读量:4311 次
发布时间:2019-06-06

本文共 822 字,大约阅读时间需要 2 分钟。

from bs4 import BeautifulSoup  import requestsa=requests.get('https://search.51job.com/list/030200,000000,0000,32,9,99,%25E5%2589%258D%25E7%25AB%25AF%25E5%25BC%2580%25E5%258F%2591,2,1.html?lang=c&stype=1&postchannel=0000&workyear=99&cotype=99&degreefrom=99&jobterm=99&companysize=99&lonlat=0%2C0&radius=-1&ord_field=0&confirmdate=9&fromType=&dibiaoid=0&address=&line=&specialarea=00&from=&welfare=')a.encoding='gbk'soup = BeautifulSoup(a.text,'html.parser')#print(soup.find_all(name='div',attrs={"class":"el"}))# print(soup.find(id = "el"))for link in soup.find_all(name='p',attrs={"class":"t1"}):    #print(link.find(attrs={"class":"t1"}).find('a'))    print(link.find('a').get('href'))    print(link.find('a').get('title'))

pip install beautifulsoup4

pip install requests

转载于:https://www.cnblogs.com/fm060/p/9101591.html

你可能感兴趣的文章
SQL Server nested loop join 效率试验
查看>>
pg数据库sql积累
查看>>
python字符串常用函数
查看>>
数据结构
查看>>
列表生成式,生成器表达式,模块
查看>>
Android注解框架实战-ButterKnife(原创)
查看>>
三、回归问题与应用
查看>>
第二届PHP全球开发者大会(含大会的PPT)
查看>>
5.23BOM
查看>>
SVN使用教程
查看>>
献给初学者:谈谈如何学习Linux操作系统
查看>>
vb中的反正弦函数
查看>>
Match:Keywords Search(AC自动机模板)(HDU 2222)
查看>>
ASM:《X86汇编语言-从实模式到保护模式》第16章:Intel处理器的分页机制和动态页面分配...
查看>>
CORS’s source, principle and implementation
查看>>
分割字符串
查看>>
选择排序
查看>>
线性表 - 公式化描述实现线性表
查看>>
javaweb搭建云服务器环境
查看>>
referer——防盗链
查看>>