摘要:
import requests from lxml import etree import os headers={ 'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox 阅读全文
posted @ 2020-12-08 22:22
nan4457
阅读(45)
评论(0)
推荐(0)
摘要:
import requests from lxml import etree url='https://bj.58.com/ershoufang/' headers={ 'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82 阅读全文
posted @ 2020-12-08 20:51
nan4457
阅读(75)
评论(0)
推荐(0)
摘要:
import requests from lxml import etree url='https://www.shicimingju.com/book/sanguoyanyi.html' headers={ 'User-Agent':'Mozilla/5.0 (Macintosh; Intel M 阅读全文
posted @ 2020-12-08 20:04
nan4457
阅读(45)
评论(0)
推荐(0)
摘要:
'''<div class="thumb">.*?<img src="(.*?)" alt.*?</div>'''import requestsimport reimport osif not os.path.exists('./糗事百科图片'): os.mkdir('./糗事百科图片')heade 阅读全文
posted @ 2020-12-08 15:32
nan4457
阅读(642)
评论(0)
推荐(0)
摘要:
import requests import json url='http://scxk.nmpa.gov.cn:81/xk/itownet/portalAction.do?method=getXkzsList' header={ 'User-Agent':'Mozilla/5.0 (Macinto 阅读全文
posted @ 2020-12-08 14:49
nan4457
阅读(51)
评论(0)
推荐(0)
摘要:
查询指定地点餐厅数 import requests import json url='http://www.kfc.com.cn/kfccda/ashx/GetStoreList.ashx?op=keyword' header={ 'User-Agent':'Mozilla/5.0 (Macinto 阅读全文
posted @ 2020-12-08 13:35
nan4457
阅读(66)
评论(0)
推荐(0)
摘要:
import requests import json url='https://movie.douban.com/j/search_subjects' header={ 'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:8 阅读全文
posted @ 2020-12-08 12:53
nan4457
阅读(62)
评论(0)
推荐(0)
摘要:
1.Ajax: 异步的js+xml,利用js在保证页面不被刷新、页面链接不改变的情况下与服务器交换数 据并更新部分网页的技术。 2.解析方法: 打开网页开发者工具/网络/type中找到xhr 请求头信息中:X-Requested-With:XMLHttpRequest,表示此请求为Ajax请求。 i 阅读全文
posted @ 2020-12-08 11:33
nan4457
阅读(85)
评论(0)
推荐(0)
摘要:
import requests#UA伪装:将对应的ueser-agent封装到一个字典中headers={ "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox/82.0 阅读全文
posted @ 2020-12-08 11:05
nan4457
阅读(124)
评论(0)
推荐(0)
摘要:
#导入requests模块import requests#放入url地址 url='https://www.sogou.com'#发起请求。用get方法返回一个响应对象response=requests.get(url)#获取响应数据.text返回的是字符串形式的响应数据 page_text=res 阅读全文
posted @ 2020-12-08 10:48
nan4457
阅读(120)
评论(0)
推荐(0)

浙公网安备 33010602011771号