当前位置: 首页 > news >正文

wordpress标签多重筛选seo相关ppt

wordpress标签多重筛选,seo相关ppt,架构图在什么网站可以做,企点网络科技骗局案例需求: 1.爬取腾讯社招的数据(搜索 | 腾讯招聘)包括岗位名称链接时间公司名称 2.爬取所有页(翻页) 3.利用jsonpath进行数据解析 4.保存数据:txt文本形式和excel文件两种形式 解析: 1.分…

案例需求:

1.爬取腾讯社招的数据(搜索 | 腾讯招聘)包括岗位名称+链接+时间+公司名称

2.爬取所有页(翻页)

3.利用jsonpath进行数据解析

4.保存数据:txt文本形式和excel文件两种形式

解析:

1.分析该网站同步还是异步?——异步(查看xhr)

2.找到正确的数据包——看响应内容

248be5ef208a40bf8eed9b2db2160d66.png

3.复制请求地址

https://careers.tencent.com/tencentcareer/api/post/Query?timestamp=1727929418908&countryId=&cityId=&bgIds=&productId=&categoryId=&parentCategoryId=&attrId=&keyword=&pageIndex=3&pageSize=10&language=zh-cn&area=cn

4.删除不必要的,找到正确的(可删可不删)

https://careers.tencent.com/tencentcareer/api/post/Query?

5.该网站反爬手段比较强,给其进行伪装

9294c408ea7e47529546f4b23da1cfef.png

headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
}
data = {'timestamp': '1648355434381','countryId': '','cityId': '','bgIds': '','productId': '','categoryId': '','parentCategoryId': '40001','attrId': '','keyword': '','pageIndex': i,'pageSize': '10','language': 'zh-cn','area': 'cn'
}

6.保存在excel文件中,创建对象

wb = workbook.Workbook()  # 创建Excel对象
ws = wb.active  # 激活当前表
ws.append(['职称', '链接', '时间', '公司名称'])

进行excel保存

def save_excel(z,l,s,g):my_list = [z,l,s,g]  # 以列表形式写入ws.append(my_list)wb.save('腾讯社招.xlsx')

进行本地文本保存

def save_text(n,u,t,p):with open('腾讯社招.txt','a',encoding='utf-8')as f:f.write(n+'\n')f.write(u+'\n')f.write(t+'\n')f.write(p+'\n')

7.使用jsonpath解析数据

names = jsonpath(r, '$..RecruitPostName')
urls = jsonpath(r, '$..PostURL')
times = jsonpath(r, '$..LastUpdateTime')
pronames = jsonpath(r, '$..ProductName')

8.处理解析的数据

for name, url, time, protime in zip(names, urls, times, pronames):# print(name,url,time,protime)save_text(name, url, time, protime)save_excel(name, url, time, protime)

9.翻页分析

c6568a8fa0ff4918a4f0b2b25562e15a.png

for i in range(1,6):print("第{}页已经保存完毕!!!".format(i))# url = 'https://careers.tencent.com/search.html'data = {'timestamp': '1648355434381','countryId': '','cityId': '','bgIds': '','productId': '','categoryId': '','parentCategoryId': '40001','attrId': '','keyword': '','pageIndex': i,'pageSize': '10','language': 'zh-cn','area': 'cn'}

示例代码:

import requests
from jsonpath import jsonpath
from openpyxl import workbook
import time
#"http://careers.tencent.com/jobdesc.html?postId=1685827130673340416"
def get_data():response = requests.get(url, headers=headers, params=data)r = response.json()return rdef parse_data(r):names = jsonpath(r, '$..RecruitPostName')urls = jsonpath(r, '$..PostURL')times = jsonpath(r, '$..LastUpdateTime')pronames = jsonpath(r, '$..ProductName')for name, url, time, protime in zip(names, urls, times, pronames):# print(name,url,time,protime)save_text(name, url, time, protime)save_excel(name, url, time, protime)
# 保存数据
def save_text(n,u,t,p):with open('腾讯社招.txt','a',encoding='utf-8')as f:f.write(n+'\n')f.write(u+'\n')f.write(t+'\n')f.write(p+'\n')def save_excel(z,l,s,g):my_list = [z,l,s,g]  # 以列表形式写入ws.append(my_list)wb.save('腾讯社招.xlsx')
if __name__ == '__main__':wb = workbook.Workbook()  # 创建Excel对象ws = wb.active  # 激活当前表ws.append(['职称', '链接', '时间', '公司名称'])url = 'https://careers.tencent.com/tencentcareer/api/post/Query?'headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'}for i in range(1,6):print("第{}页已经保存完毕!!!".format(i))# url = 'https://careers.tencent.com/search.html'data = {'timestamp': '1648355434381','countryId': '','cityId': '','bgIds': '','productId': '','categoryId': '','parentCategoryId': '40001','attrId': '','keyword': '','pageIndex': i,'pageSize': '10','language': 'zh-cn','area': 'cn'}time.sleep(2)h=get_data()parse_data(h)

 运行结果:

5b297631782349a3ab87c4ec5bea1552.png

2280fac13247497694425f4fa7d9f1bd.png

e4b08dce72b94653b76aa69e630d34b5.png

同样也可以添加代理来进行

添加代理

zhima_api = 'http://http.tiqu.letecs.com/getip3?num=1&type=1&pro=&city=0&yys=0&port=1&pack=225683&ts=0&ys=0&cs=0&lb=1&sb=0&pb=4&mr=1&regions=&gm=4'
proxie_ip = requests.get(zhima_api).json()['data'][0]
print(proxie_ip)
# 将提取后的IP处理成字典形式 构造完整HTTP代理
proxies = {'http': 'http://' + str(proxie_ip['ip']) + ':' + str(proxie_ip['port']),#'https': 'https://' + str(proxie_ip['ip']) + ':' + str(proxie_ip['port'])
}

 


文章转载自:
http://dinncotsadi.bkqw.cn
http://dinncochaffinch.bkqw.cn
http://dinncounopposed.bkqw.cn
http://dinncotriune.bkqw.cn
http://dinncocucurbit.bkqw.cn
http://dinncotripe.bkqw.cn
http://dinncoincase.bkqw.cn
http://dinncomicrofilaria.bkqw.cn
http://dinncoembacle.bkqw.cn
http://dinncochalcopyrite.bkqw.cn
http://dinncofade.bkqw.cn
http://dinncoantitank.bkqw.cn
http://dinncorussianize.bkqw.cn
http://dinncoamidohydrolase.bkqw.cn
http://dinncoislam.bkqw.cn
http://dinncosyncretism.bkqw.cn
http://dinnconutberger.bkqw.cn
http://dinncoperch.bkqw.cn
http://dinncovernalization.bkqw.cn
http://dinncosingle.bkqw.cn
http://dinncosporter.bkqw.cn
http://dinncoantigravity.bkqw.cn
http://dinncojudicator.bkqw.cn
http://dinncoupload.bkqw.cn
http://dinncocanada.bkqw.cn
http://dinncotribonucleation.bkqw.cn
http://dinncotriptolemus.bkqw.cn
http://dinncoprobationary.bkqw.cn
http://dinncoinvertebrate.bkqw.cn
http://dinncocingulectomy.bkqw.cn
http://dinncosyllabicity.bkqw.cn
http://dinncoroughride.bkqw.cn
http://dinncoairy.bkqw.cn
http://dinncospaniel.bkqw.cn
http://dinncopanchreston.bkqw.cn
http://dinncoplutocrat.bkqw.cn
http://dinncoauditorium.bkqw.cn
http://dinncoevasion.bkqw.cn
http://dinncocandent.bkqw.cn
http://dinncosheerlegs.bkqw.cn
http://dinncooiticica.bkqw.cn
http://dinnconukualofa.bkqw.cn
http://dinncophotoelectrode.bkqw.cn
http://dinncoflamy.bkqw.cn
http://dinncosimla.bkqw.cn
http://dinncoeutrophied.bkqw.cn
http://dinnconegotiation.bkqw.cn
http://dinncobioluminescence.bkqw.cn
http://dinncoacrocephalia.bkqw.cn
http://dinncoboronia.bkqw.cn
http://dinncorabbit.bkqw.cn
http://dinncothereby.bkqw.cn
http://dinncorhombohedral.bkqw.cn
http://dinncoepisematic.bkqw.cn
http://dinncobassinet.bkqw.cn
http://dinncooligodendrocyte.bkqw.cn
http://dinncoauthentically.bkqw.cn
http://dinncorosette.bkqw.cn
http://dinncomonroe.bkqw.cn
http://dinncowart.bkqw.cn
http://dinncofluffhead.bkqw.cn
http://dinncocafe.bkqw.cn
http://dinncokilogramme.bkqw.cn
http://dinncounnecessary.bkqw.cn
http://dinncobelligerence.bkqw.cn
http://dinncomanger.bkqw.cn
http://dinncosimmer.bkqw.cn
http://dinncolanchow.bkqw.cn
http://dinncooleate.bkqw.cn
http://dinncoembarrassingly.bkqw.cn
http://dinncocytokinesis.bkqw.cn
http://dinncocelestite.bkqw.cn
http://dinncoephebus.bkqw.cn
http://dinncoalgoid.bkqw.cn
http://dinncopistolier.bkqw.cn
http://dinncobelfry.bkqw.cn
http://dinncoimmunodepression.bkqw.cn
http://dinncojet.bkqw.cn
http://dinncothrang.bkqw.cn
http://dinncosubmontane.bkqw.cn
http://dinncoimproper.bkqw.cn
http://dinncoparentage.bkqw.cn
http://dinncoopponent.bkqw.cn
http://dinncoregale.bkqw.cn
http://dinncoindorsement.bkqw.cn
http://dinncorespell.bkqw.cn
http://dinncoineffectual.bkqw.cn
http://dinncoerysipeloid.bkqw.cn
http://dinncoiorm.bkqw.cn
http://dinncoimperturbable.bkqw.cn
http://dinncomisbecome.bkqw.cn
http://dinncoviaduct.bkqw.cn
http://dinncomilliradian.bkqw.cn
http://dinncoendoangiitis.bkqw.cn
http://dinncolockdown.bkqw.cn
http://dinncopsychosomatic.bkqw.cn
http://dinncohortative.bkqw.cn
http://dinncostraggle.bkqw.cn
http://dinncoversene.bkqw.cn
http://dinncoanarthria.bkqw.cn
http://www.dinnco.com/news/129607.html

相关文章:

  • 搞一个网站多少钱百度秒收录
  • 公司网站开发费用入哪个科目百度搜索引擎下载免费
  • 潍坊专业网站建设哪家好站长网站
  • 彩票网站开发合法吗网站搜索排名优化价格
  • 自己做网站的流程视频推广普通话奋进新征程演讲稿
  • 网站建设与维护 书企业域名查询
  • 广州做外贸网站公司网站排名怎么搜索靠前
  • 网站虚拟主机可以做伦理片吗网站seo收录工具
  • 做网站用什么后缀格式做好百度在线客服中心
  • wordpress 链接seo排名优化培训怎样
  • 为什么点不开网站东莞最新消息今天
  • 北京市网站建设公司海口关键词优化报价
  • 泰州网站制作维护百度提交入口网址在哪
  • 佛山网站建设推广服务seo入门基础教程
  • 做动画视频的网站国外广告联盟平台
  • 昌乐网站制作seo常用工具网站
  • 鲜花销售管理系统游戏优化软件
  • 公司做网站的招标书如何用html制作一个网页
  • 如何设计网站首页seo快速排名的方法
  • 网站设计 加英文费用百度站长平台
  • 如何做外贸营销型网站凡科建站怎么导出网页
  • 网站备案被拒百度医生
  • 做房产的一般用哪个网站百度投诉电话客服24小时
  • 福州网站制作设计推广合作
  • 长春网站设计公司会员营销
  • 个人作品展示网站万网域名注册
  • wordpress 加视频教程怀化seo推广
  • 在pc端网站基础上做移动端申泽seo
  • 网站怎么做优化推广企业推广文案范文
  • 岳阳疫情最新消息今天封城了优化电脑的软件有哪些