某小说网站之内容获取
Published on 2024-04-21 15:20 in 暂未分类 with 萧海~

某小说网站之内容获取

    import requests
    headers = {
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Cache-Control': 'no-cache',
    'Pragma': 'no-cache',
    'Proxy-Connection': 'keep-alive',
    'Referer': 'http://www.h528.com/',
    'Upgrade-Insecure-Requests': '1',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
    }
    response = requests.get('http://www.h528.com/post/25126.html', headers=headers, verify=False)
    html=etree.HTML(response.text)
    href=html.xpath('//div[@class="entry"]/p/text()')
    print(''.join(href))
    posted @   萧海~  阅读(26)  评论(0编辑  收藏  举报
    相关博文:
    阅读排行:
    · winform 绘制太阳,地球,月球 运作规律
    · AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
    · 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
    · 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
    · 上周热点回顾(3.3-3.9)
    历史上的今天:
    2021-04-21 Qt开发经验小技巧131-140
    2021-04-21 Qt 在线程中使用EXCLE办法
    2021-04-21 Qt 在线程中导出EXCLE报 CoCreateInstance failure (尚未调用 CoInitialize) 解决办法
    2021-04-21 Qt 操作Excel错误:QAxBase: Error calling IDispatch member WorkSheets: Unknown error
    2021-04-21 Qt中自定义qDebug打印信息的宏(文件名,行数,时间等等)
    2021-04-21 QT应用编程:基于VLC开发音视频播放器(回调方式)
    2021-04-21 QT应用编程:基于VLC开发音视频播放器(句柄方式)
    点击右上角即可分享
    微信分享提示
    电磁波切换