【发布时间】:2023-03-12 14:16:01
【问题描述】:
我编写了生成视频链接的代码,如下所示。 获得后,我尝试以这种方式下载它:
import urllib.request
import os
url = 'http://www.videodetective.net/flash/players/?customerid=300120&playerid=351&publishedid=319113&playlistid=0&videokbrate=750&sub=RTO&pversion=5.2%22%20width=%22670%22%20height=%22360%22'
response = urllib.request.urlopen(url).read()
outpath = os.path.join(os.getcwd(), 'video.mp4')
videofile = open(outpath , 'wb')
videofile.write(response)
videofile.close()
我得到的只是该目录中无法读取的 58kB 文件。有人能指出我正确的方向吗?
【问题讨论】:
-
@Sologoub:这和这个问题有什么关系?
-
如果他想弄清楚,我链接到的代码可以作为一个工作的开始......虽然,正如你指出的那样,错误似乎更明显。
标签: python screen-scraping web-scraping