当前位置:网站首页>将网页变成字符串,并保存起来
将网页变成字符串,并保存起来
2022-08-04 18:51:00 【狗庄欺人太甚】
def get_items(req):
"""使用Xpath解析页面,提取商品信息"""
if (type(req) == str):
html = etree.HTML(req)
else:
html = etree.HTML(req.text)
with open('/cloud/cloud_disk/users/huh/nlp/smart_home/script/super_Reptile/kk.txt','w') as fp:
fp.writelines(str(req.text))
边栏推荐
- 动态数组底层是如何实现的
- 当前最快的实例分割模型:YOLACT 和 YOLACT++
- 如何进行自动化测试?【Eolink分享】
- 【填空题】130道面试填空题
- How can test engineers break through career bottlenecks?
- Short-term reliability and economic evaluation of resilient microgrids under incentive-based demand response programs (Matlab code implementation)
- 火灾报警联网FC18中CAN光端机常见问题解答和使用指导
- JS 问号?妙用
- Hezhou Cat1 4G module Air724UG is configured with RNDIS network card or PPP dial-up, and the development board is connected to the Internet through the RNDIS network card (taking the RV1126/1109 devel
- Flink / Scala - 使用 RedisSink 存储数据
猜你喜欢
PHP代码审计9—代码执行漏洞
The CPU suddenly soars and the system responds slowly, what is the cause?Is there any way to check?
CPU突然飙高系统反应慢,是怎么导致的?有什么办法排查?
#yyds干货盘点# 面试必刷TOP101:链表相加(二)
在表格数据集上训练变分自编码器 (VAE)示例
Google AppSheet: 无需编程构建零代码应用
阿里云国际版使用ROS搭建WordPress教程
”元宇宙“必须具备这些特点
CAN光纤转换器CAN光端机解决消防火灾报警
Develop those things: How to obtain the traffic statistics of the monitoring site through the EasyCVR platform?
随机推荐
LVS+Keepalived群集
vantui 组件 van-field 路由切换时,字体样式混乱问题
curl命令的那些事
【填空题】130道面试填空题
当项目中自动格式化插件Prettier和ESLint冲突报错时如何解决
WPF 使用封装的 SharpDx 控件
Regardless of whether you are a public, professional or non-major class, I have been sorting out the learning route for a long time here, and the learning route I have summarized is not yet rolled up
浅谈web网站架构演变过程
【杰神说说】物联大师2.0版本预告
阿里云国际版使用ROS搭建WordPress教程
链表的经典入门LeetCode题目
合宙Cat1 4G模块Air724UG配置RNDIS网卡或PPP拨号,通过RNDIS网卡使开发板上网(以RV1126/1109开发板为例)
unity中实现ue眼球的渲染
如何让 JS 代码不可断点
【简答题】月薪4k和月薪8k的区别就在这里
win10 uwp MVVM 语义耦合
单行、多行文本超出显示省略号
win10 uwp 修改Pivot Header 颜色
基于3D机器视觉的采血试管分拣系统
WPF 元素裁剪 Clip 属性