摘要: 解析 xpath使用 安装lxml库 pip install lxml ‐i https://pypi.douban.com/simple pip install lxml -i https://mirrors.aliyun.com/pypi/simple 导入lxml etree from lxm 阅读全文
posted @ 2024-07-11 20:11 donghongchao 阅读(2) 评论(0) 推荐(0) 编辑
摘要: cookie登录 编码反爬 cookie中携带者个人登录信息,如果有登录之后的cookie,那么我们可以携带者cookie进入到任何页面 # 适用的场景:数据采集的时候 需要绕过登陆 然后进入到某个页面 # 个人信息页面是utf-8 但是还报错了编码错误 因为并没有进入到个人信息页面 而是跳转到了登 阅读全文
posted @ 2024-07-11 15:49 donghongchao 阅读(5) 评论(0) 推荐(0) 编辑
摘要: ajax的post请求 import urllib.request import urllib.parse # url = 'https://www.kfc.com.cn/kfccda/ashx/GetStoreList.ashx?op=cname' # # headers = { # 'user- 阅读全文
posted @ 2024-07-11 12:01 donghongchao 阅读(5) 评论(0) 推荐(0) 编辑
摘要: import urllib import urllib.request import urllib.parse import json #分析获取数据 url = 'https://movie.douban.com/j/chart/top_list?type=24&interval_id=100%3 阅读全文
posted @ 2024-07-11 10:38 donghongchao 阅读(2) 评论(0) 推荐(0) 编辑