上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页
摘要: #!/usr/bin/python from lxml import etree if __name__ == "__main__": #实例化一个etree对象,且将被解析的源码加载到了该对象中 tree = etree.parse('test.html') r = tree.xpath('./h 阅读全文
posted @ 2020-07-28 08:42 一只小白呀 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python import requests from bs4 import BeautifulSoup #需求:爬取三国演义小说所有的章节标题和章节内容http://www.shicimingju.com/book/sanguoyanyi.html if __name__ = 阅读全文
posted @ 2020-07-28 08:40 一只小白呀 阅读(233) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python import requests import re import os #需求:爬取糗事百科中的图片 if __name__ == "__main__": headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0 阅读全文
posted @ 2020-07-28 08:38 一只小白呀 阅读(182) 评论(0) 推荐(0) 编辑
摘要: #!usr/bin/python from bs4 import BeautifulSoup if __name__ == "__main__": #将本地的html文档中的数据加载到该对象中 fp = open('./test.html', 'r', encoding='utf-8') soup 阅读全文
posted @ 2020-07-28 08:37 一只小白呀 阅读(145) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python import requests import re import os #需求:爬取糗事百科中的图片 if __name__ == "__main__": #创建一个文件夹,保存所有图片 if not os.path.exists('./qiutuLibs'): 阅读全文
posted @ 2020-07-28 08:36 一只小白呀 阅读(67) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python import requests if __name__ == "__main__": #如何让爬取图片数据 url = 'https://pic.qiushibaike.com/system/pictures/12337/123378655/medium/WEH2 阅读全文
posted @ 2020-07-28 08:34 一只小白呀 阅读(106) 评论(0) 推荐(0) 编辑
摘要: import requests import json if __name__ == "__main__": headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like 阅读全文
posted @ 2020-07-28 08:33 一只小白呀 阅读(1316) 评论(0) 推荐(0) 编辑
摘要: import requests import json if __name__ == "__main__": url = 'https://movie.douban.com/j/chart/top_list' param = { 'type':'24', 'interval_id':'100:90' 阅读全文
posted @ 2020-07-28 08:31 一只小白呀 阅读(238) 评论(0) 推荐(0) 编辑
摘要: import requests #UA伪装: #UA:User-Agent(请求载体的身份标识)检测: #门户网站的服务器会检测对应请求的身份载体标识,如果检测到请求的载体身份标识为某一款浏览器 #说明该请求是一个正常的请求,但是,如果检测到请求的载体身份标识不是某一款浏览器的,则表示该请求不是正常 阅读全文
posted @ 2020-07-28 08:30 一只小白呀 阅读(179) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python import requests if __name__ == "__main__": url = 'https://sogou.com' response = requests.get(url=url) page_text = response.text prin 阅读全文
posted @ 2020-07-28 08:29 一只小白呀 阅读(84) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页