我想从此webpage获取视频网址的xpath,以便可以使用python下载this video。
我要做的是按F12键并找到“视频”部分,然后在“视频类”下,右键单击源并复制xpath。但是我无法使用python检索网址。我得到的xpath是:
//*[@id="player"]/@src
这是我使用的python代码:
url = 'https://www.kickstarter.com/projects/peak-design/travel-tripod-by-peak-design?ref=discovery_category_newest'
res = requests.get(url=url)
tree = html.fromstring(res.text)
video_url = tree.xpath('//*[@id="player"]/@src')
print(video_url)