# coding=utf-8import requestsfrom lxml import etreea='https://www.dytt8.net'headers={ 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWeb ...
分类:
其他好文 时间:
2019-07-20 10:10:13
阅读次数:
156
#需求:抓取猫眼电影TOP100的电影名称、时间、评分、图片等信息,提取的结果会以文件的形式保存下来 import requests import time from lxml import etree import json import csv import codecs class MaoYa... ...
分类:
其他好文 时间:
2019-07-14 00:12:07
阅读次数:
111
从0开始学爬虫3之xpath的介绍和使用 Xpath:一种HTML和XML的查询语言,它能在XML和HTML的树状结构中寻找节点 安装xpath: pip install lxml HTML 超文本标记语言(HyperText Mark-up Language),是一种规范,一种标准,是构成网页文档 ...
分类:
其他好文 时间:
2019-07-08 13:32:52
阅读次数:
91
一、 bs4安装与使用 '''''' ''' 安装解析器: pip3 install lxml 安装解析库: pip3 install bs4 ''' html_doc = """ <html><head><title>The Dormouse's story</title></head> <bod ...
分类:
其他好文 时间:
2019-07-04 00:42:40
阅读次数:
106
''' 安装解析器: pip3 install lxml 安装解析库: pip3 install bs4 ''' html_doc = ''' The Dormouse's story $37 Once upon a time there were three little sisters; and... ...
分类:
编程语言 时间:
2019-07-03 20:20:47
阅读次数:
127
1.什么是BeautifulSoup4 BS4是一个解析库,可以通过某种(解析器)来帮我们提取想要的2.为什么要用BS4 它可以用简洁的语言帮我们快速提取想要的数据3.解析器的分类 (1)html.parser (2)lxml html_doc = """ The Dormouse's story ... ...
分类:
其他好文 时间:
2019-07-03 19:57:30
阅读次数:
103
今天试着把前面那个爬取图片的爬虫改成了多线程爬取,虽然最后可以爬取存储图片了,但仍存在一些问题。网址还是那个网址https://www.quanjing.com/category/1286521/1.html, 下面是代码,难点直接在后面注释了。 刚开始,我想把爬取的所有图片都放在一个文件夹了,但却 ...
分类:
编程语言 时间:
2019-07-03 13:54:01
阅读次数:
177
from bs4 import BeautifulSoup from lxml import html import xml import requests #下载图片函数 def download_img(url,name): """" 下载指定url的图片 url:图片的url; name:保存... ...
分类:
编程语言 时间:
2019-07-01 14:19:06
阅读次数:
122
#爬取站长素材中的免费建立模板 import requests from lxml import etree import random headers = { "User-Agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML... ...
分类:
Web程序 时间:
2019-06-30 23:14:50
阅读次数:
279