Home > other >  For bosses to explain why this little crawlers can't run anymore?????
For bosses to explain why this little crawlers can't run anymore?????

Time:10-06


The import requests
The import re
Headers={
"The user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36 ",
"Referer" : "https://video.pearvideo.com"
}
#
Url='https://www.pearvideo.com/video_1633183'
Url1='https://video.pearvideo.com/mp4/adshort/20191216/cont-1633183-14703452_adpkg-ad_hd.mp4'
Print (url)
Request=requests. Get (url)
# print (request. Text)
# src_list=re. The.findall (" srcUrl=". *?" , a vdoUrl=srcUrl 're. S)

Src_list=re. The.findall (' ldUrl=", "srcUrl=" (. *?) "' request. The text)
# print (src_list)
For the SRC in src_list:
Print (SRC)
Into print (' 1 ')
The response=requests. Get (SRC, headers=headers)
Into print (' 2 ')
FileName="movie \ " + "1" + "mp4"
Print (" is save the file: "+ fileName)
With the open (fileName, "wb") as f:
F.w rite (response. The content)

CodePudding user response:


Specified file storage paths, it is suggested that in the current path can be used./

CodePudding user response:

You are to be stored in the specified path you can use the OS module chdir method, look at, very powerful

CodePudding user response:

reference 1st floor MuSa xiaoxiang reply:

The specified file storage paths, Suggestions on the current path can be used./

Thank you, I think in the project file is ok

CodePudding user response:

Also can be in the project, the front path add a..
Said a layer on the path

CodePudding user response:

Made a mistake, the current path is directly with the open and other paths with inside the open a new path, don't give with slanting

CodePudding user response:

,,, directly into 1 run in to less than 2 why is this? Don't get

CodePudding user response:

refer to 6th floor in small even chi response:
,,, directly into 1 run in to less than 2 why is this? Don't get

Stick figure!
  • Related