The text of text and images from the network, only to learn, exchange, not for any commercial purposes, belongs to original author, if any questions, please contact us for treatment.
Author: Woo_home
PS: If necessary Python learning materials can be added to a small partner click the link below to obtain their own
http://note.youdao.co-m/noteshare?id=3054cce4add8a909e784ad934f956cef
Installation Library
This example uses the library to have requests, lxml, re, where re is the python comes, there is no need to install, the installation only requests to the library and lxml
Installation command as follows:
pip install requests
pip install lxml
Analysis of data pages
Open a video page is as follows:
Right-be developer mode, right-click on a video, click Open in new tab
ok, you can open
Code
First import library to be used
import requests
from lxml import etree
import re
Get the site UR L
Gets User-Agent
Initiate a request
save data
Download video has been saved in a folder