import requests
from lxml import html
url='https://music.douban.com/' #需要爬的网址
page=requests.Session().get(url)
tree=html.fromstring(page.text)
result=tree.xpath('//tr//a/text()') #需要获取的数据
result1=tree.xpath('//tr//a/@href')
result2=tree.xpath('//tr[last()]//a/@href')
print(result)
print(result1)
print(result2)
28d43bf3dcc4d7c742c5660ef55810f8246b5b18
<mask token>

<mask token>
print(result)
print(result1)
print(result2)

<mask token>
url = 'https://music.douban.com/'
page = requests.Session().get(url)
tree = html.fromstring(page.text)
result = tree.xpath('//tr//a/text()')
result1 = tree.xpath('//tr//a/@href')
result2 = tree.xpath('//tr[last()]//a/@href')
print(result)
print(result1)
print(result2)

import requests
from lxml import html
url = 'https://music.douban.com/'
page = requests.Session().get(url)
tree = html.fromstring(page.text)
result = tree.xpath('//tr//a/text()')
result1 = tree.xpath('//tr//a/@href')
result2 = tree.xpath('//tr[last()]//a/@href')
print(result)
print(result1)
print(result2)

import requests
from lxml import html
url='https://music.douban.com/' #需要爬的网址
page=requests.Session().get(url)
tree=html.fromstring(page.text)
result=tree.xpath('//tr//a/text()') #需要获取的数据
result1=tree.xpath('//tr//a/@href')
result2=tree.xpath('//tr[last()]//a/@href')
print(result)
print(result1)
print(result2)