摘要: requests import requests response=requests.get('http://www.baidu.com') print(response.status_code) print(response.text) print(response.cookies) 图片下载保存 阅读全文
posted @ 2019-08-22 00:33 心随沙动 阅读(95) 评论(0) 推荐(0)
摘要: lxml 安装 pip3 install lxml ( pip install lxml ) 导入 from lxml import etree https://www.cnblogs.com/gaochsh/p/6757475.html XPath的基本语法知识: 1) // 双斜杠 定位根节点, 阅读全文
posted @ 2019-08-22 00:33 心随沙动 阅读(199) 评论(0) 推荐(0)
摘要: https://www.cnblogs.com/strivepy/p/9231127.html urllib是python内置的http请求库(基本请求库 ,requests库就是通过urllib是实现的),各种功能相比较之下也是比较完备的,urllib库包含了一下四个模块: urllib.requ 阅读全文
posted @ 2019-08-22 00:31 心随沙动 阅读(141) 评论(0) 推荐(0)
摘要: maoyan import requests import json from lxml import etree def getOnePage(n): url=f'https://maoyan.com/board/4?offset={(n 1) 10}' headers={'User Agent' 阅读全文
posted @ 2019-08-22 00:23 心随沙动 阅读(93) 评论(0) 推荐(0)